63std::vector<G4WorkerRunManager*>* G4MTRunManagerKernel::workerRMvector =
nullptr;
78#ifndef G4MULTITHREADED
80 msg <<
"Geant4 code is compiled without multi-threading support "
83 msg <<
" This type of RunManager can only be used in mult-threaded "
85 G4Exception(
"G4RunManagerKernel::G4RunManagerKernel()",
"Run0109",
89 if(workerRMvector ==
nullptr)
90 workerRMvector =
new std::vector<G4WorkerRunManager*>;
100 if(workerRMvector !=
nullptr)
102 if(workerRMvector->size() > 0)
105 msg <<
"G4MTRunManagerKernel is to be deleted while "
106 << workerRMvector->size() <<
" G4WorkerRunManager are still alive.";
107 G4Exception(
"G4RunManagerKernel::~G4RunManagerKernel()",
"Run10035",
110 delete workerRMvector;
111 workerRMvector =
nullptr;
126 return wThreadContext;
146 wThreadContext = context;
195 workerRMvector->push_back(wrm);
204 wrm->G4RunManager::SetUserInitialization(
239 for(
auto itrWrm = workerRMvector->cbegin();
240 itrWrm != workerRMvector->cend(); ++itrWrm)
244 workerRMvector->erase(itrWrm);
255 wThreadContext =
nullptr;
271 for(
G4int i = 0; i < nCh; ++i)
284 for(
auto itr = workerRMvector->cbegin(); itr != workerRMvector->cend(); ++itr)
286 (*itr)->AbortRun(softAbort);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
G4VDecayChannel * GetDecayChannel(G4int index) const
void BroadcastAbortRun(G4bool softAbort)
static G4WorkerThread * GetWorkerThread()
void SetUpDecayChannels()
virtual ~G4MTRunManagerKernel()
void SetupShadowProcess() const
static void StartThread(G4WorkerThread *context)
G4int GetPinAffinity() const
const CLHEP::HepRandomEngine * getMasterRandomEngine() const
static G4MTRunManager * GetMasterRunManager()
void reset(G4bool ifSkipIon=true)
G4PTblDicIterator * GetIterator() const
static G4ParticleTable * GetParticleTable()
virtual void SetupShadowProcess() const
const G4UserWorkerInitialization * GetUserWorkerInitialization() const
virtual void Initialize()
const G4VUserDetectorConstruction * GetUserDetectorConstruction() const
const G4VUserActionInitialization * GetUserActionInitialization() const
G4VUserActionInitialization * GetNonConstUserActionInitialization() const
const G4VUserPhysicsList * GetUserPhysicsList() const
const G4UserWorkerThreadInitialization * GetUserWorkerThreadInitialization() const
void SetUpForAThread(G4int tId)
static G4UImanager * GetUIpointer()
virtual void WorkerStop() const
virtual void WorkerInitialize() const
virtual void WorkerStart() const
virtual void SetupRNGEngine(const CLHEP::HepRandomEngine *aRNGEngine) const
virtual G4WorkerRunManager * CreateWorkerRunManager() const
G4ParticleDefinition * GetDaughter(G4int anIndex)
static void SetInstance(G4VSteppingVerbose *Instance)
virtual void Build() const =0
virtual G4VSteppingVerbose * InitializeSteppingVerbose() const
void SetWorkerThread(G4WorkerThread *wc)
virtual void SetUserInitialization(G4VUserPhysicsList *userInit)
G4int GetThreadId() const
static void BuildGeometryAndPhysicsVector()
static void DestroyGeometryAndPhysicsVector()
void SetPinAffinity(G4int aff) const
G4int WorkerThreadJoinsPool()
G4int WorkerThreadLeavesPool()
void SetMultithreadedApplication(G4bool value)
void G4SetThreadId(G4int aNewValue)