61std::vector<G4WorkerRunManager*>* G4MTRunManagerKernel::workerRMvector =
nullptr;
75#ifndef G4MULTITHREADED
77 msg <<
"Geant4 code is compiled without multi-threading support "
80 msg <<
" This type of RunManager can only be used in mult-threaded "
85 if (workerRMvector ==
nullptr) workerRMvector =
new std::vector<G4WorkerRunManager*>;
95 if (workerRMvector !=
nullptr) {
96 if (!workerRMvector->empty()) {
98 msg <<
"G4MTRunManagerKernel is to be deleted while " << workerRMvector->size()
99 <<
" G4WorkerRunManager are still alive.";
102 delete workerRMvector;
103 workerRMvector =
nullptr;
118 return wThreadContext;
138 wThreadContext = context;
181 workerRMvector->push_back(wrm);
220 for (
auto itrWrm = workerRMvector->cbegin(); itrWrm != workerRMvector->cend(); ++itrWrm) {
221 if ((*itrWrm) == wrm) {
222 workerRMvector->erase(itrWrm);
233 wThreadContext =
nullptr;
247 for (
G4int i = 0; i < nCh; ++i) {
259 for (
const auto& itr : *workerRMvector) {
260 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)
void SetupShadowProcess() const override
static G4WorkerThread * GetWorkerThread()
void SetUpDecayChannels()
~G4MTRunManagerKernel() override
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 WorkerStart() const
virtual void WorkerInitialize() const
virtual void SetupRNGEngine(const CLHEP::HepRandomEngine *aRNGEngine) const
virtual G4WorkerRunManager * CreateWorkerRunManager() const
G4ParticleDefinition * GetDaughter(G4int anIndex)
static void SetInstance(G4VSteppingVerbose *Instance)
virtual G4VSteppingVerbose * InitializeSteppingVerbose() const
virtual void Build() const =0
void SetWorkerThread(G4WorkerThread *wc)
void SetUserInitialization(G4VUserPhysicsList *userInit) override
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)