-
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
Support manual addition/exclusion of volumes in HitManager #772
Support manual addition/exclusion of volumes in HitManager #772
Conversation
Can you clear compilation errors from HitProcessor.test.cc? |
@whokion I pushed a fix just minutes before you asked ;) |
@sethrj I failed to test this PR with CMSSW/cmsRun as there is a crash from VecGeom (unrelated to this MR, see |
WTF CI:
|
@sethrj Is this branch rebased with the remote develop? I want to test this PR with the sd option on as CMSSW+celeritas with the run3 geometry is now working again with all recent updates in VecGeom and celeritas. |
Defining SDs on workers but not master is unfortunately forbidden by the regular Geant4 run manager so we can't reproduce it in-house: the SDs defined on the worker thread are subsequently deleted.
@whokion Yes, it's got all the features that develop has. It would be great if you could test it! I'm writing a unit test now but that can happen asynchronously with your testing. Thanks! |
accel/detail/HitManager.cc:144 should follow a similar recipe like if-else blocks in |
Ooh, good point. I'll fix that right away. Thanks! |
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.
Let's merge this for v0.3. Thanks for all good works!
Co-authored-by: Soon Yung Jun <syjun@fnal.gov>
@@ -35,12 +35,26 @@ class HitProcessor; | |||
* exclusions for SDs that are implemented natively on GPU) | |||
* - Maps those volumes to VecGeom geometry | |||
* - Creates a HitProcessor for each Geant4 thread | |||
* | |||
* \warning Because of low-level problems with Geant4 allocators, the |
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.
🐿️
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.
Thanks! I'll fix it in the v0.3 branch.
Is the function really large or is it indirectly the case due to in-lining? |
@pcanal I'm guessing it's inlining with debug code that's doing it? The function itself is super short and I was surprised that it's the only one that triggered. |
This is an attempt to address the multithreading problem where CMSSW defines SDs only on workers but not on the master thread. This prevents the export of the SD tag by the GDML exporter, and it also prevents our HitManager from automatically detecting the LVs that correspond to sensitive volumes.
This MR attempts to replicate the behavior with the
skipMasterSD
option. However, defining SDs on workers but not master is unfortunately forbidden by the regular Geant4 run manager so we can't reproduce it in-house: the SDs defined on the worker thread are subsequently deleted.Even though we can't reproduce the exact CMSSW behavior, this MR should provide an alternative path: there is a new SD setup option that lets you define a set of LV pointers which will be later queried for SDs on the worker threads.
Additionally I've added a "skip" option so that we can selectively turn off hit mapping on a per-detector basis, so that we could e.g. have a custom HGCal GPU-based detector but send any other hits back to the CPU.
@drbenmorgan this is the issue I was discussing in today's meeting.