-
Notifications
You must be signed in to change notification settings - Fork 45
Offload optical photons from Geant4 to optical track #2135
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
base: develop
Are you sure you want to change the base?
Offload optical photons from Geant4 to optical track #2135
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2135 +/- ##
===========================================
- Coverage 83.68% 83.45% -0.24%
===========================================
Files 1257 1260 +3
Lines 42470 42588 +118
Branches 13287 13330 +43
===========================================
- Hits 35542 35541 -1
- Misses 4597 4704 +107
- Partials 2331 2343 +12
🚀 New features to boost your workflow:
|
Test summary 2 517 files 4 084 suites 1m 29s ⏱️ Results for commit 91c9469. ♻️ This comment has been updated with latest results. |
* Fix vecgeom 2 CUDA build failure due to IWYU in nav state/tuple * Add hudson vg2 profiles * Fix vecgeom failures by initializing navstatetuple on device * Fix build with navpath * CudaManager is only valid when CUDA
a9f5b71 to
d8f1b58
Compare
sethrj
left a comment
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.
Nice! Just a couple of comments. Swing by my office if you have any questions.
| "cacheVariables": { | ||
| "CELERITAS_VecGeom_SURFACE": {"type": "BOOL", "value": "OFF"} | ||
| } | ||
| }, |
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.
I think this may have been unintentional?
| } | ||
| auto* lt = dynamic_cast<LocalOpticalTrackOffload*>(offload.get()); | ||
| CELER_VALIDATE(lt, | ||
| << "Cannot access LocalOpticalTrtackOffload when " |
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.
| << "Cannot access LocalOpticalTrtackOffload when " | |
| << "Cannot access LocalOpticalTrackOffload when " |
| "optical " | ||
| "track offload at the same time"); |
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.
Reformatting after breaking a string can introduce some weirdness like this (I wish clang-format could auto-join strings too). To avoid this you can do like on line 190 and use R"(...)" which is unbreakable
|
|
||
| //---------------------------------------------------------------------------// | ||
| /*! | ||
| * Generate optical photons track. |
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.
| * Generate optical photons track. | |
| * Generate with individual optical photon tracks copied from CPU. |
| // Build optical track transporter | ||
| optical::Transporter::Input inp; | ||
| inp.params = optical_params; | ||
| if (action_times) | ||
| { | ||
| inp.action_times = ActionTimes::make_and_insert( | ||
| optical_params->action_reg(), | ||
| core_params->aux_reg(), | ||
| "optical-action-times"); | ||
| } | ||
|
|
||
| result.optical_transporter | ||
| = std::make_shared<optical::Transporter>( | ||
| std::move(inp)); |
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.
Consolidate this duplicate code with the above into a free function build_optical_transporter and use it for both cases:
| // Build optical track transporter | |
| optical::Transporter::Input inp; | |
| inp.params = optical_params; | |
| if (action_times) | |
| { | |
| inp.action_times = ActionTimes::make_and_insert( | |
| optical_params->action_reg(), | |
| core_params->aux_reg(), | |
| "optical-action-times"); | |
| } | |
| result.optical_transporter | |
| = std::make_shared<optical::Transporter>( | |
| std::move(inp)); | |
| result.optical_transporter | |
| = build_optical_transporter(core_params, optical_params, action_times); |
| std::shared_ptr<optical::Transporter> optical_transporter; // optical | ||
| // primary w/ | ||
| // haydens | ||
| // class |
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.
Delete comment
| { | ||
| return std::make_unique<LSOOTrackingAction>(); | ||
| } | ||
| }; |
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.
Can you also override EndOfRunAction (see LarSphereOptical::EndOfRunAction in TrackingManagerIntegration) to check that optical tracks were run?
This PR introduces optical track offloading from Geant4 to Celeritas #2103
LocalOpticalOffloadis renamed toLocalOpticalGenOffloadto distinguish generator-based optical offloading from track-based offloading.TrackOffloadInterfacegeneralizes the tracking manager to support both EM and optical track offload implementations.LocalOpticalTrackOffloadclasses provide a dedicated pathway for buffering and transporting (in the follow up PR) optical photon tracks.