Skip to content
Not built

Changes

Summary

  1. Implement offload to Celeritas from Geant4 using G4VTrackingManager hook (#1050) (details)
  2. Update tests to pass with cuRAND (#1052) (details)
Commit 2f17ea09b9d68be3a227f72aac69feb16ade75fb by noreply
Implement offload to Celeritas from Geant4 using G4VTrackingManager hook (#1050)

* Implement concrete G4VTrackingManager for offload to Celeritas

Interface for offload of tracks to Celeritas via Geant4's G4VTrackingManager
hook introduced in v11.0, complementing existing fast simulation,
tracking action offload strategies.

Implementations of offload and flush largely follow those of
existing fast simulation offload. Build/PreparePhysicsTable are
overidden to ensure Geant4 tables for the particle(s) handled
by the tracking manager are rebuilt and thus available to
Celeritas to build its tables. This follows the Geant4 extended
runAndEvent/RE07 example.

Restrict build of class to Geant4 11.0 and higher as abstract
G4VTrackingManager interface is not available prior to that.

* Minimal example of using TrackingManagerOffload

Largely copy-paste of existing simple/fastsim offload examples, adapted
for new TrackingManagerOffload class. Primary changes are:

* Custom physics constructor inheriting from G4EmStandardPhysics
  * Overrides ConstructProcess, taking base class defaults except for
    constructing a TrackingManagerOffload instance and adding this
    to the electron, positron, and gamma particle definitions
* Replace EM physics in FTFP_BERT physics lists with this new physics
  constructor

* Add basic docs on TrackingManagerOffload

* Remove particle type validation

Prepare/BuildPhysicsTable have to be called before Celeritas'
SharedParams can be constructed, and so the list of offloadable
particles will be empty.

Remove validation check here as it cannot be run at this point.

* Log call to ConstructProcess to clarify use on master/worker

Co-authored-by: Seth R. Johnson <johnsonsr@ornl.gov>

* Add trailing full stop to satisfy Doxygen autobrief

* Test offload examples in each Geant4 threading model

For each offload example, add a test that runs it with each of Geant4's
threading types:

- Serial
- MT (standard C++ threads)
- Tasking (PTL-based tasks+threadpool)

Only enable the latter two if the found Geant4 supports them.

* Clarify implementations of physics table functions

- Use contracts on pointers that require deref
- Follow GeantImporter implementation for loop over processes

A cleaner range-based for over processes isn't possible due to
G4ProcessVector not providing a directly compatible interface.
The file was addedexample/accel/trackingmanager-offload.cc
The file was modified src/accel/CMakeLists.txt (diff)
The file was modified doc/main/examples/geant4.rst (diff)
The file was modified example/accel/CMakeLists.txt (diff)
The file was addedsrc/accel/TrackingManagerOffload.hh
The file was addedsrc/accel/TrackingManagerOffload.cc
Commit 5cb4a8f74649bfd6ba730de9f6385940252bd549 by noreply
Update tests to pass with cuRAND (#1052)

The file was modified test/celeritas/user/Diagnostic.test.cc (diff)
The file was modified test/celeritas/global/StepperTestBase.cc (diff)
The file was modified test/celeritas/user/StepCollector.test.cc (diff)
The file was modified test/celeritas/global/AlongStep.test.cc (diff)
The file was modified test/celeritas/geo/HeuristicGeoTestBase.cc (diff)
The file was modified test/celeritas/global/Stepper.test.cc (diff)
The file was modified test/celeritas/global/StepperTestBase.hh (diff)