celeritas-project / celeritas

Celeritas is a new Monte Carlo transport code designed to accelerate scientific discovery in high energy physics by improving detector simulation throughput and energy efficiency using GPUs.
https://celeritas-project.github.io/celeritas/user/index.html
Other
63 stars 34 forks source link

Implement spline interpolation #213

Open sethrj opened 3 years ago

sethrj commented 3 years ago

Spline interpolation (or some other nonlinear interpolation) is used in Geant4 by :

Research why it's necessary (the energy loss one provides an explanation of the consequences of linear interpolation, although it seems to me an alternate interpolation scheme such as log-log might have the same effect with less overheard) and compare spline interpolation with alternatives.

sethrj commented 2 years ago

@amandalund and @stognini : you ran some instances of TestEm3 with and without spline interpolation, and with refined energy grids. Can you post/reference any of the results/analysis when you get a chance?

stognini commented 2 years ago

Here is the test I currently have. Celeritas is showing slightly larger differences. Plot details:

spline_plot.pdf

amandalund commented 2 years ago

I had run TestEm3 with Celeritas with refined energy grids (1e7 primaries, 1mm production cuts): edep_binning Default is 7 bins/decade, and the error is relative to the 112 bins/decade result.

stognini commented 2 years ago

Just ran a short test on Summit. The input, cpu run script, and results are in benchmarks/testem3-demo-loop/g4app-summit/, but here is the gist of it:

Spline Avg. wall time [s]
ON 176.2
OFF 170.5

Time penalty is roughly 3%.

sethrj commented 2 years ago

Nice! I'll do a run with increased data points for comparison to see what the penalty is there.

sethrj commented 2 years ago

I've added an interface to our input to allow adjustment of the number of data points: see https://github.com/celeritas-project/celeritas/pull/414 .

sethrj commented 1 year ago

Let's wait until refactoring the physics to use standard 'builders' before doing this.