Celeritas 0.7.0-dev.252+develop.478e7a17
Loading...
Searching...
No Matches
Classes | Functions
GeantUtils.hh File Reference
#include "corecel/Config.hh"
#include "corecel/Assert.hh"
#include "corecel/Types.hh"

Classes

struct  celeritas::StreamablePD
 Wrap around a G4ParticleDefinition to get a descriptive output. More...
 

Functions

int celeritas::get_geant_num_threads (G4RunManager const &runman)
 Get the number of threads in a version-portable way.
 
int celeritas::get_geant_num_threads ()
 Get the number of threads from the global run manager.
 
int celeritas::get_geant_thread_id ()
 Get the Geant4 thread ID.
 
void celeritas::validate_geant_threading (size_type num_streams)
 Validate the thread ID and threading model.
 
std::ostream & celeritas::operator<< (std::ostream &os, StreamablePD const &ppd)
 Print a particle definition name and PDG.
 

Function Documentation

◆ get_geant_num_threads()

int celeritas::get_geant_num_threads ( G4RunManager const runman)
inline

Get the number of threads in a version-portable way.

G4RunManager::GetNumberOfThreads isn't virtual before Geant4 v10.7.0 so we need to explicitly dynamic cast to G4MTRunManager to get the number of threads.

In tasking mode, the result may be zero!