-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Construct CoreParams from new problem input in celer-sim #1601
base: develop
Are you sure you want to change the base?
Conversation
This means it's more difficult to get the processed input if there's an error, but it makes the structure easier.
Test summary 4 497 files 6 923 suites 13m 11s ⏱️ Results for commit 82ee9c6. ♻️ This comment has been updated with latest results. |
Currently I'm hitting an error trying to run celer-sim on the GPU: /home/alund/celeritas_project/celeritas/app/celer-sim/celer-sim.cc:273: critical: While running input at simple-cms-gpu.inp.json: celeritas: runtime error: celeritas::activate_device may be called only once per application
/home/alund/celeritas_project/celeritas/src/corecel/sys/Device.cc:308: '!d' failed |
Glad someone here is paying attention 😅 I'll check it out on wildstyle and fix. |
@amandalund all tests pass on a debug+openmp+cuda build on wildstyle! |
Awesome, thanks! I'll get back to this today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good @sethrj! One kind of odd thing is the results on this branch were different from develop (but still statistically the same) when I tried running the cms2018 problem below. Is there any reason the results might have changed?
cms2018 json input
{ "geometry_file": "/home/alund/celeritas_project/regression/input/cms2018.gdml", "physics_options": { "coulomb_scattering": false, "eloss_fluctuation": true, "em_bins_per_decade": 56, "lpm": true, "msc": "urban", "physics": "em_basic", "rayleigh_scattering": true }, "brem_combined": false, "primary_options": { "seed": 12345, "direction": {"distribution": "isotropic"}, "energy": 10000, "num_events": 8, "pdg": 11, "position": [0, 0, 0], "primaries_per_event": 130 }, "initializer_capacity": 8388608, "num_track_slots": 65536, "field": [0.0, 0.0, 1.0], "step_diagnostic": true, "step_diagnostic_bins": 1000, "max_events": 1024, "secondary_stack_factor": 3.0, "seed": 20220905, "merge_events": false, "action_times": false, "use_device": false }
// celeritas::device is reset) | ||
if (celeritas::device()) | ||
{ | ||
celeritas::device().create_streams(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also do this in SharedParams
, maybe we should have a Device::destroy_streams()
?
@@ -207,6 +265,9 @@ inp::StandaloneInput to_input(RunnerInput const& ri) | |||
si.problem = load_problem(ri); | |||
if (!ri.physics_file.empty()) | |||
{ | |||
CELER_VALIDATE( | |||
ends_with(ri.physics_file, ".root"), | |||
<< R"(physics_file must be a ROOT input: use GDML for geometry_file and if forcing an ORANGE geometry, use the `ORANGE_FORCE_INPUT` environment variable)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should GDML physics/org.json ORANGE be deprecated input formats? Or are we not worrying about backward compatibility here.
return EventReader{rfe.event_file, nullptr}.num_events(); | ||
}, | ||
}, | ||
si.events); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're getting the number of events here, could we also update the number of streams to not be more than the number of events?
namespace setup | ||
{ | ||
//---------------------------------------------------------------------------// | ||
struct StandaloneLoaded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this be used?
if constexpr (CELERITAS_CORE_GEO == CELERITAS_CORE_GEO_ORANGE) | ||
{ | ||
static char const fi_hack_envname[] = "ORANGE_FORCE_INPUT"; | ||
auto const& filename = celeritas::getenv(fi_hack_envname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this hack necessary?
|
||
//---------------------------------------------------------------------------// | ||
/*! | ||
* Costruct magnetic field from variant input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update description.
This follow-on to #1562 moves the core construction from
app/celer-sim
toceleritas/setup
. I removed a couple of small capabilities related to the deprecated celer-sim json input for now:Changed in
inp
:inp::StateCapacity
into core/opticalstd::optional
rather than sentinel values