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
58 stars 32 forks source link

Log and kill geometry/propagation errors #1290

Closed sethrj closed 2 days ago

sethrj commented 1 week ago

This replaces the "kill looping tracks" with an explicit kernel for killing tracks, and replaces a host-only "validate" for tracks being inside the geometry and having a valid material ID. It logs descriptions and error messages for each of these cases.

A follow-on PR will add internal error states to the geometry tracking so we can catch issues with the current ORANGE implementation.

See https://github.com/celeritas-project/celeritas/issues/687 .

sethrj commented 1 week ago

This was a bit of a half-baked idea, you're perfectly right about the looping track not being the same as a geometry error. Maybe we should just make this a "tracking cut" action? Should we print log messages immediately when the error occurs?

It also exposes some of the fragility in our implementation... there's still a test failure due to a hardcoded condition not being met...

amandalund commented 1 week ago

Yeah, a "tracking cut" or more generic kind of "track killer" action might make more sense, same with printing the whole error message immediately.

sethrj commented 1 week ago

OK I think I'm going to rework this: maybe a combination of

sethrj commented 2 days ago

I'm going to close this in favor of a fresh PR.