Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4TaskRunManager Class Reference

#include <G4TaskRunManager.hh>

+ Inheritance diagram for G4TaskRunManager:

Public Types

using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Run >
 
using InitializeSeedsCallback = std::function< G4bool(G4int, G4int &, G4int &)>
 
using RunTaskGroup = G4TaskGroup< void >
 
using RunTaskGroupTBB = G4TBBTaskGroup< void >
 
- Public Types inherited from G4MTRunManager
enum class  WorkerActionRequest { UNDEFINED , NEXTITERATION , PROCESSUI , ENDWORKER }
 
using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Run >
 
typedef std::map< G4int, G4VPhysicalVolume * > masterWorlds_t
 
- Public Types inherited from G4RunManager
enum  RMType { sequentialRM , masterRM , workerRM }
 
using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Run >
 
- Public Types inherited from PTL::TaskRunManager
typedef TaskRunManagerpointer
 

Public Member Functions

 G4TaskRunManager (G4bool useTBB=G4GetEnv< G4bool >("G4USE_TBB", false))
 
 G4TaskRunManager (G4VUserTaskQueue *taskQueue, G4bool useTBB=G4GetEnv< G4bool >("G4USE_TBB", false), G4int evtGrainsize=0)
 
virtual ~G4TaskRunManager ()
 
void SetGrainsize (G4int n)
 
G4int GetGrainsize () const
 
G4int GetNumberOfTasks () const
 
G4int GetNumberOfEventsPerTask () const
 
virtual void SetNumberOfThreads (G4int n) override
 
virtual G4int GetNumberOfThreads () const override
 
virtual size_t GetNumberActiveThreads () const override
 
virtual void Initialize () override
 
virtual void InitializeEventLoop (G4int n_event, const char *macroFile=nullptr, G4int n_select=-1) override
 
virtual void InitializeThreadPool () override
 
G4bool ThreadPoolIsInitialized () const
 
virtual void Initialize (uint64_t nthreads) override
 
virtual void TerminateOneEvent () override
 
virtual void ProcessOneEvent (G4int i_event) override
 
virtual void ConstructScoringWorlds () override
 
virtual void RunTermination () override
 
virtual G4bool SetUpAnEvent (G4Event *, G4long &s1, G4long &s2, G4long &s3, G4bool reseedRequired=true) override
 
virtual G4int SetUpNEvents (G4Event *, G4SeedsQueue *seedsQueue, G4bool reseedRequired=true) override
 
void MergeScores (const G4ScoringManager *localScoringManager)
 
void MergeRun (const G4Run *localRun)
 
virtual void RequestWorkersProcessCommandsStack () override
 
virtual void ThisWorkerProcessCommandsStackDone () override
 
virtual void WaitForReadyWorkers () override
 
virtual void WaitForEndEventLoopWorkers () override
 
virtual void ThisWorkerReady () override
 
virtual void ThisWorkerEndEventLoop () override
 
virtual WorkerActionRequest ThisWorkerWaitForNextAction () override
 
void SetInitializeSeedsCallback (InitializeSeedsCallback f)
 
virtual void AbortRun (G4bool softAbort=false) override
 
virtual void AbortEvent () override
 
- Public Member Functions inherited from G4MTRunManager
 G4MTRunManager ()
 
virtual ~G4MTRunManager ()
 
virtual void SetNumberOfThreads (G4int n)
 
virtual G4int GetNumberOfThreads () const
 
void SetPinAffinity (G4int n=1)
 
G4int GetPinAffinity () const
 
virtual void Initialize ()
 
virtual void InitializeEventLoop (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void InitializeThreadPool ()
 
virtual void TerminateOneEvent ()
 
virtual void ProcessOneEvent (G4int i_event)
 
virtual void ConstructScoringWorlds ()
 
virtual void RunTermination ()
 
virtual G4bool SetUpAnEvent (G4Event *, long &s1, long &s2, long &s3, G4bool reseedRequired=true)
 
virtual G4int SetUpNEvents (G4Event *, G4SeedsQueue *seedsQueue, G4bool reseedRequired=true)
 
std::vector< G4StringGetCommandStack ()
 
virtual size_t GetNumberActiveThreads () const
 
virtual void ThisWorkerReady ()
 
virtual void ThisWorkerEndEventLoop ()
 
const CLHEP::HepRandomEnginegetMasterRandomEngine () const
 
virtual void SetUserInitialization (G4VUserPhysicsList *userPL)
 
virtual void SetUserInitialization (G4VUserDetectorConstruction *userDC)
 
virtual void SetUserInitialization (G4UserWorkerInitialization *userInit)
 
virtual void SetUserInitialization (G4UserWorkerThreadInitialization *userInit)
 
virtual void SetUserInitialization (G4VUserActionInitialization *userInit)
 
virtual void SetUserAction (G4UserRunAction *userAction)
 
virtual void SetUserAction (G4VUserPrimaryGeneratorAction *userAction)
 
virtual void SetUserAction (G4UserEventAction *userAction)
 
virtual void SetUserAction (G4UserStackingAction *userAction)
 
virtual void SetUserAction (G4UserTrackingAction *userAction)
 
virtual void SetUserAction (G4UserSteppingAction *userAction)
 
void MergeScores (const G4ScoringManager *localScoringManager)
 
void MergeRun (const G4Run *localRun)
 
virtual void RequestWorkersProcessCommandsStack ()
 
virtual void ThisWorkerProcessCommandsStackDone ()
 
virtual WorkerActionRequest ThisWorkerWaitForNextAction ()
 
void SetEventModulo (G4int i=1)
 
G4int GetEventModulo () const
 
virtual void AbortRun (G4bool softAbort=false)
 
virtual void AbortEvent ()
 
- Public Member Functions inherited from G4RunManager
 G4RunManager ()
 
virtual ~G4RunManager ()
 
virtual void BeamOn (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void Initialize ()
 
virtual void DefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
 
virtual void AbortRun (G4bool softAbort=false)
 
virtual void AbortEvent ()
 
virtual void InitializeGeometry ()
 
virtual void InitializePhysics ()
 
virtual G4bool ConfirmBeamOnCondition ()
 
virtual void RunInitialization ()
 
virtual void DoEventLoop (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void RunTermination ()
 
virtual void InitializeEventLoop (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void ProcessOneEvent (G4int i_event)
 
virtual void TerminateOneEvent ()
 
virtual void TerminateEventLoop ()
 
virtual G4EventGenerateEvent (G4int i_event)
 
virtual void AnalyzeEvent (G4Event *anEvent)
 
virtual void ConfigureProfilers (const std::vector< std::string > &args={})
 
void ConfigureProfilers (int argc, char **argv)
 
virtual void SetNumberOfThreads (G4int)
 
virtual G4int GetNumberOfThreads () const
 
void DumpRegion (const G4String &rname) const
 
void DumpRegion (G4Region *region=0) const
 
virtual void rndmSaveThisRun ()
 
virtual void rndmSaveThisEvent ()
 
virtual void RestoreRandomNumberStatus (const G4String &fileN)
 
virtual void SetUserInitialization (G4VUserDetectorConstruction *userInit)
 
virtual void SetUserInitialization (G4VUserPhysicsList *userInit)
 
virtual void SetUserInitialization (G4VUserActionInitialization *userInit)
 
virtual void SetUserInitialization (G4UserWorkerInitialization *userInit)
 
virtual void SetUserInitialization (G4UserWorkerThreadInitialization *userInit)
 
virtual void SetUserAction (G4UserRunAction *userAction)
 
virtual void SetUserAction (G4VUserPrimaryGeneratorAction *userAction)
 
virtual void SetUserAction (G4UserEventAction *userAction)
 
virtual void SetUserAction (G4UserStackingAction *userAction)
 
virtual void SetUserAction (G4UserTrackingAction *userAction)
 
virtual void SetUserAction (G4UserSteppingAction *userAction)
 
const G4VUserDetectorConstructionGetUserDetectorConstruction () const
 
const G4VUserPhysicsListGetUserPhysicsList () const
 
const G4VUserActionInitializationGetUserActionInitialization () const
 
G4VUserActionInitializationGetNonConstUserActionInitialization () const
 
const G4UserWorkerInitializationGetUserWorkerInitialization () const
 
const G4UserWorkerThreadInitializationGetUserWorkerThreadInitialization () const
 
const G4UserRunActionGetUserRunAction () const
 
const G4VUserPrimaryGeneratorActionGetUserPrimaryGeneratorAction () const
 
const G4UserEventActionGetUserEventAction () const
 
const G4UserStackingActionGetUserStackingAction () const
 
const G4UserTrackingActionGetUserTrackingAction () const
 
const G4UserSteppingActionGetUserSteppingAction () const
 
void SetNumberOfAdditionalWaitingStacks (G4int iAdd)
 
const G4StringGetVersionString () const
 
void SetPrimaryTransformer (G4PrimaryTransformer *pt)
 
void StoreRandomNumberStatusToG4Event (G4int vl)
 
G4int GetFlagRandomNumberStatusToG4Event () const
 
void SetRandomNumberStore (G4bool flag)
 
G4bool GetRandomNumberStore () const
 
void SetRandomNumberStoreDir (const G4String &dir)
 
const G4StringGetRandomNumberStoreDir () const
 
const G4StringGetRandomNumberStatusForThisRun () const
 
const G4StringGetRandomNumberStatusForThisEvent () const
 
void SetRandomNumberStorePerEvent (G4bool flag)
 
G4bool GetRandomNumberStorePerEvent () const
 
void GeometryHasBeenModified (G4bool prop=true)
 
void ReinitializeGeometry (G4bool destroyFirst=false, G4bool prop=true)
 
void PhysicsHasBeenModified ()
 
void CutOffHasBeenModified ()
 
void ReOptimizeMotherOf (G4VPhysicalVolume *)
 
void ReOptimize (G4LogicalVolume *)
 
void SetVerboseLevel (G4int vl)
 
G4int GetVerboseLevel () const
 
G4int GetPrintProgress ()
 
void SetPrintProgress (G4int i)
 
void SetGeometryToBeOptimized (G4bool vl)
 
G4bool GetGeometryToBeOptimized ()
 
void SetNumberOfEventsToBeStored (G4int val)
 
const G4RunGetCurrentRun () const
 
G4RunGetNonConstCurrentRun () const
 
const G4EventGetCurrentEvent () const
 
const G4EventGetPreviousEvent (G4int i) const
 
void SetRunIDCounter (G4int i)
 
G4int GetNumberOfParallelWorld () const
 
void SetNumberOfEventsToBeProcessed (G4int val)
 
G4int GetNumberOfEventsToBeProcessed () const
 
G4int GetNumberOfSelectEvents () const
 
G4String GetSelectMacro () const
 
void SetDCtable (G4DCtable *DCtbl)
 
RMType GetRunManagerType () const
 
virtual void ConstructScoringWorlds ()
 
virtual void RestoreRndmEachEvent (G4bool)
 
void GeometryDirectlyUpdated (G4bool val=true)
 
- Public Member Functions inherited from PTL::TaskRunManager
 TaskRunManager (bool useTBB=false)
 
virtual ~TaskRunManager ()
 
virtual int GetNumberOfThreads () const
 
virtual size_t GetNumberActiveThreads () const
 
virtual void Initialize (uint64_t n=std::thread::hardware_concurrency())
 
virtual void Terminate ()
 
ThreadPoolGetThreadPool () const
 
TaskManagerGetTaskManager () const
 
bool IsInitialized () const
 
int GetVerbose () const
 
void SetVerbose (int val)
 

Static Public Member Functions

static G4ThreadId GetMasterThreadId ()
 
static G4TaskRunManagerGetMasterRunManager ()
 
static G4TaskRunManagerKernelGetMTMasterRunManagerKernel ()
 
- Static Public Member Functions inherited from G4MTRunManager
static G4ThreadId GetMasterThreadId ()
 
static G4ScoringManagerGetMasterScoringManager ()
 
static masterWorlds_tGetMasterWorlds ()
 
static void addWorld (G4int counter, G4VPhysicalVolume *w)
 
static G4MTRunManagerGetMasterRunManager ()
 
static G4RunManagerKernelGetMasterRunManagerKernel ()
 
static G4MTRunManagerKernelGetMTMasterRunManagerKernel ()
 
static G4int SeedOncePerCommunication ()
 
static void SetSeedOncePerCommunication (G4int val)
 
static G4ThreadId GetMasterTheadId ()
 
- Static Public Member Functions inherited from G4RunManager
static G4RunManagerGetRunManager ()
 
static G4bool IfGeometryHasBeenDestroyed ()
 
- Static Public Member Functions inherited from PTL::TaskRunManager
static TaskRunManagerGetInstance (bool useTBB=false)
 
static TaskRunManagerGetMasterRunManager (bool useTBB=false)
 

Protected Member Functions

virtual void ComputeNumberOfTasks ()
 
virtual G4bool InitializeSeeds (G4int) override
 
virtual void RefillSeeds () override
 
virtual void StoreRNGStatus (const G4String &filenamePrefix) override
 
virtual void CreateAndStartWorkers () override
 
virtual void TerminateWorkers () override
 
virtual void NewActionRequest (WorkerActionRequest) override
 
virtual void AddEventTask (G4int)
 
- Protected Member Functions inherited from G4MTRunManager
virtual G4bool InitializeSeeds (G4int)
 
virtual void PrepareCommandsStack ()
 
virtual void StoreRNGStatus (const G4String &filenamePrefix)
 
virtual void rndmSaveThisRun ()
 
virtual void rndmSaveThisEvent ()
 
virtual void CreateAndStartWorkers ()
 
virtual void WaitForReadyWorkers ()
 
virtual void WaitForEndEventLoopWorkers ()
 
virtual void TerminateWorkers ()
 
virtual void NewActionRequest (WorkerActionRequest newRequest)
 
virtual void RefillSeeds ()
 
- Protected Member Functions inherited from G4RunManager
void CleanUpPreviousEvents ()
 
void CleanUpUnnecessaryEvents (G4int keepNEvents)
 
void StackPreviousEvent (G4Event *anEvent)
 
 G4RunManager (RMType rmType)
 
virtual void StoreRNGStatus (const G4String &filenamePrefix)
 
void UpdateScoring ()
 
virtual void DeleteUserInitializations ()
 

Protected Attributes

RunTaskGroupworkTaskGroup = nullptr
 
G4boolpoolInitialized = PTL::TaskRunManager::m_is_initialized
 
G4ThreadPool *& threadPool = PTL::TaskRunManager::m_thread_pool
 
G4VUserTaskQueue *& taskQueue = PTL::TaskRunManager::m_task_queue
 
G4TaskManager *& taskManager = PTL::TaskRunManager::m_task_manager
 
InitializeSeedsCallback initSeedsCallback
 
- Protected Attributes inherited from G4MTRunManager
G4int nworkers
 
G4int forcedNwokers
 
G4int numberOfEventToBeProcessed
 
WorkerActionRequest nextActionRequest
 
G4int eventModuloDef
 
G4int eventModulo
 
G4int nSeedsUsed
 
G4int nSeedsFilled
 
G4int nSeedsMax
 
G4int nSeedsPerEvent
 
double * randDbl
 
G4MTBarrier beginOfEventLoopBarrier
 
G4MTBarrier endOfEventLoopBarrier
 
G4MTBarrier nextActionRequestBarrier
 
G4MTBarrier processUIBarrier
 
- Protected Attributes inherited from G4RunManager
G4RunManagerKernelkernel
 
G4EventManagereventManager
 
G4VUserDetectorConstructionuserDetector
 
G4VUserPhysicsListphysicsList
 
G4VUserActionInitializationuserActionInitialization
 
G4UserWorkerInitializationuserWorkerInitialization
 
G4UserWorkerThreadInitializationuserWorkerThreadInitialization
 
G4UserRunActionuserRunAction
 
G4VUserPrimaryGeneratorActionuserPrimaryGeneratorAction
 
G4UserEventActionuserEventAction
 
G4UserStackingActionuserStackingAction
 
G4UserTrackingActionuserTrackingAction
 
G4UserSteppingActionuserSteppingAction
 
G4bool geometryInitialized
 
G4bool physicsInitialized
 
G4bool runAborted
 
G4bool initializedAtLeastOnce
 
G4bool geometryToBeOptimized
 
G4int runIDCounter
 
G4int verboseLevel
 
G4int printModulo
 
G4Timertimer
 
G4DCtableDCtable
 
G4RuncurrentRun
 
G4EventcurrentEvent
 
std::list< G4Event * > * previousEvents
 
G4int n_perviousEventsToBeStored
 
G4int numberOfEventToBeProcessed
 
G4bool storeRandomNumberStatus
 
G4int storeRandomNumberStatusToG4Event
 
G4String randomNumberStatusDir
 
G4String randomNumberStatusForThisRun
 
G4String randomNumberStatusForThisEvent
 
G4bool rngStatusEventsFlag
 
G4VPhysicalVolumecurrentWorld
 
G4int nParallelWorlds
 
G4String msgText
 
G4int n_select_msg
 
G4int numberOfEventProcessed
 
G4String selectMacro
 
G4bool fakeRun
 
G4bool isScoreNtupleWriter
 
RMType runManagerType
 
G4bool geometryDirectlyUpdated
 
- Protected Attributes inherited from PTL::TaskRunManager
bool m_is_initialized = false
 
int m_verbose = 0
 
uint64_t m_workers = 0
 
VUserTaskQueuem_task_queue = nullptr
 
ThreadPoolm_thread_pool = nullptr
 
TaskManagerm_task_manager = nullptr
 

Friends

class G4RunManagerFactory
 

Additional Inherited Members

- Static Protected Attributes inherited from G4MTRunManager
static G4MTRUN_DLL G4ScoringManagermasterScM = 0
 
static G4MTRUN_DLL masterWorlds_t masterWorlds
 
static G4MTRUN_DLL G4MTRunManagerfMasterRM = 0
 
static G4ThreadId masterThreadId = G4ThisThread::get_id()
 
static G4int seedOncePerCommunication = 0
 
- Static Protected Attributes inherited from G4RunManager
static G4RUN_DLL G4bool fGeometryHasBeenDestroyed = false
 

Detailed Description

Definition at line 66 of file G4TaskRunManager.hh.

Member Typedef Documentation

◆ InitializeSeedsCallback

Definition at line 76 of file G4TaskRunManager.hh.

◆ ProfilerConfig

◆ RunTaskGroup

Definition at line 77 of file G4TaskRunManager.hh.

◆ RunTaskGroupTBB

Definition at line 78 of file G4TaskRunManager.hh.

Constructor & Destructor Documentation

◆ G4TaskRunManager() [1/2]

G4TaskRunManager::G4TaskRunManager ( G4bool  useTBB = G4GetEnv<G4bool>("G4USE_TBB", false))

Definition at line 161 of file G4TaskRunManager.cc.

162 : G4TaskRunManager(nullptr, useTBB, 0)
163{}

◆ G4TaskRunManager() [2/2]

G4TaskRunManager::G4TaskRunManager ( G4VUserTaskQueue taskQueue,
G4bool  useTBB = G4GetEnv<G4bool>("G4USE_TBB", false),
G4int  evtGrainsize = 0 
)

Definition at line 76 of file G4TaskRunManager.cc.

79 , PTL::TaskRunManager(useTBB)
80 , eventGrainsize(grainsize)
81 , numberOfEventsPerTask(-1)
82 , numberOfTasks(-1)
83 , masterRNGEngine(nullptr)
84 , workTaskGroup(nullptr)
85{
86 if(task_queue)
87 taskQueue = task_queue;
88
89 // override default of 2 from G4MTRunManager
90 nworkers = std::thread::hardware_concurrency();
91 fMasterRM = this;
92 MTkernel = static_cast<G4TaskRunManagerKernel*>(kernel);
93
94 G4int numberOfStaticAllocators = kernel->GetNumberOfStaticAllocators();
95 if(numberOfStaticAllocators > 0)
96 {
98 msg1 << "There are " << numberOfStaticAllocators
99 << " static G4Allocator objects detected.\n"
100 << "In multi-threaded mode, all G4Allocator objects must "
101 << "be dynamicly instantiated.";
102 G4Exception("G4TaskRunManager::G4TaskRunManager", "Run1035", FatalException,
103 msg1);
104 }
105
108
109 // use default RandomNumberGenerator if created by user, or create default
110 masterRNGEngine = G4Random::getTheEngine();
111
114
115 //------------------------------------------------------------------------//
116 // handle threading
117 //------------------------------------------------------------------------//
118 G4String _nthread_env = G4GetEnv<G4String>("G4FORCENUMBEROFTHREADS", "max");
119 for(auto& itr : _nthread_env)
120 itr = tolower(itr);
121
122 if(_nthread_env == "max")
124 else
125 {
126 std::stringstream ss;
127 G4int _nthread_val = -1;
128 ss << _nthread_env;
129 ss >> _nthread_val;
130 if(_nthread_val > 0)
131 forcedNwokers = _nthread_val;
132
133 if(forcedNwokers > 0)
135 }
136
137 //------------------------------------------------------------------------//
138 // option for forcing TBB
139 //------------------------------------------------------------------------//
140#ifdef GEANT4_USE_TBB
141 G4int _useTBB = G4GetEnv<G4int>("G4FORCE_TBB", (G4int) useTBB);
142 if(_useTBB > 0)
143 useTBB = true;
144#else
145 if(useTBB)
146 {
148 msg << "TBB was requested but Geant4 was not built with TBB support";
149 G4Exception("G4TaskRunManager::G4TaskRunManager(...)", "Run0131",
150 JustWarning, msg);
151 }
152 useTBB = false;
153#endif
154
155 // handle TBB
157}
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4int numberOfEventToBeProcessed
static G4MTRUN_DLL G4ScoringManager * masterScM
static G4MTRUN_DLL G4MTRunManager * fMasterRM
G4int GetNumberOfStaticAllocators() const
G4RunManagerKernel * kernel
static G4ScoringManager * GetScoringManagerIfExist()
G4VUserTaskQueue *& taskQueue
RunTaskGroup * workTaskGroup
void SetMasterUIManager(G4bool val)
Definition: G4UImanager.hh:212
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
static void set_use_tbb(bool val)
Definition: ThreadPool.cc:100
G4int G4GetNumberOfCores()
Definition: G4Threading.cc:121

◆ ~G4TaskRunManager()

G4TaskRunManager::~G4TaskRunManager ( )
virtual

Definition at line 167 of file G4TaskRunManager.cc.

168{
169 if(workTaskGroup)
170 {
172 delete workTaskGroup;
173 }
174 // finalize profiler before shutting down the threads
176 if(threadPool)
179}
static void Finalize()
Definition: G4Profiler.cc:331
G4ThreadPool *& threadPool
Up join(Up accum={})
Definition: TaskGroup.hh:274
virtual void Terminate()
size_type destroy_threadpool()
Definition: ThreadPool.cc:366

Member Function Documentation

◆ AbortEvent()

void G4TaskRunManager::AbortEvent ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 744 of file G4TaskRunManager.cc.

745{
746 // nothing to do in the master thread
747}

◆ AbortRun()

void G4TaskRunManager::AbortRun ( G4bool  softAbort = false)
overridevirtual

virtual void ResetNavigator() const;

Reimplemented from G4MTRunManager.

Definition at line 726 of file G4TaskRunManager.cc.

727{
728 // This method is valid only for GeomClosed or EventProc state
729 G4ApplicationState currentState =
731 if(currentState == G4State_GeomClosed || currentState == G4State_EventProc)
732 {
733 runAborted = true;
734 MTkernel->BroadcastAbortRun(softAbort);
735 }
736 else
737 {
738 G4cerr << "Run is not in progress. AbortRun() ignored." << G4endl;
739 }
740}
G4ApplicationState
@ G4State_EventProc
@ G4State_GeomClosed
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4bool runAborted
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
void BroadcastAbortRun(G4bool softAbort)

◆ AddEventTask()

void G4TaskRunManager::AddEventTask ( G4int  nt)
protectedvirtual

Definition at line 440 of file G4TaskRunManager.cc.

441{
442 if(verboseLevel > 1)
443 G4cout << "Adding task " << nt << " to task-group..." << G4endl;
445}
G4GLOB_DLL std::ostream G4cout
G4int verboseLevel
void exec(Func &&func, Args... args)
Definition: TaskGroup.hh:215

Referenced by CreateAndStartWorkers().

◆ ComputeNumberOfTasks()

void G4TaskRunManager::ComputeNumberOfTasks ( )
protectedvirtual

Definition at line 304 of file G4TaskRunManager.cc.

305{
306 G4int grainSize = (eventGrainsize == 0) ? threadPool->size() : eventGrainsize;
307 grainSize =
308 G4GetEnv<G4int>("G4FORCE_GRAINSIZE", grainSize, "Forcing grainsize...");
309 if(grainSize == 0)
310 grainSize = 1;
311
312 G4int nEvtsPerTask = (numberOfEventToBeProcessed > grainSize)
313 ? (numberOfEventToBeProcessed / grainSize)
314 : 1;
315
316 if(fakeRun)
317 nEvtsPerTask = G4GetEnv<G4int>(
318 "G4FORCE_EVENTS_PER_TASK", nEvtsPerTask,
319 "Forcing number of events per task (overrides grainsize)...");
320 else
321 nEvtsPerTask = G4GetEnv<G4int>("G4FORCE_EVENTS_PER_TASK", nEvtsPerTask);
322
323 if(nEvtsPerTask < 1)
324 nEvtsPerTask = 1;
325
326 numberOfTasks = numberOfEventToBeProcessed / nEvtsPerTask;
327 numberOfEventsPerTask = nEvtsPerTask;
328 eventModulo = numberOfEventsPerTask;
329
330 if(fakeRun && verboseLevel > 1)
331 {
332 std::stringstream msg;
333 msg << "--> G4TaskRunManager::ComputeNumberOfTasks() --> " << numberOfTasks
334 << " tasks with " << numberOfEventsPerTask << " events/task...";
335
336 std::stringstream ss;
337 ss.fill('=');
338 ss << std::setw(msg.str().length()) << "";
339 G4cout << "\n"
340 << ss.str() << "\n"
341 << msg.str() << "\n"
342 << ss.str() << "\n"
343 << G4endl;
344 }
345}
size_type size() const
Definition: ThreadPool.hh:151

Referenced by CreateAndStartWorkers(), and InitializeEventLoop().

◆ ConstructScoringWorlds()

void G4TaskRunManager::ConstructScoringWorlds ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 606 of file G4TaskRunManager.cc.

607{
609 // Call base class stuff...
611
612 masterWorlds.clear();
613 size_t nWorlds =
615 std::vector<G4VPhysicalVolume*>::iterator itrW =
617 for(size_t iWorld = 0; iWorld < nWorlds; ++iWorld)
618 {
619 addWorld(iWorld, *itrW);
620 ++itrW;
621 }
622}
static void addWorld(G4int counter, G4VPhysicalVolume *w)
static G4MTRUN_DLL masterWorlds_t masterWorlds
virtual void ConstructScoringWorlds()
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
size_t GetNoWorlds() const

◆ CreateAndStartWorkers()

void G4TaskRunManager::CreateAndStartWorkers ( )
overrideprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 349 of file G4TaskRunManager.cc.

350{
351 // Now loop on requested number of workers
352 // This will also start the workers
353 // Currently we do not allow to change the
354 // number of threads: threads area created once
355 // Instead of pthread based workers, create tbbTask
356 static bool initializeStarted = false;
357
359
360 if(fakeRun)
361 {
362 if(initializeStarted)
363 {
364 auto initCmdStack = GetCommandStack();
365 if(!initCmdStack.empty())
366 {
367 threadPool->execute_on_all_threads([initCmdStack]() {
368 for(auto& itr : initCmdStack)
369 G4UImanager::GetUIpointer()->ApplyCommand(itr);
371 });
372 }
373 }
374 else
375 {
376 std::stringstream msg;
377 msg << "--> G4TaskRunManager::CreateAndStartWorkers() --> "
378 << "Initializing workers...";
379
380 std::stringstream ss;
381 ss.fill('=');
382 ss << std::setw(msg.str().length()) << "";
383 G4cout << "\n"
384 << ss.str() << "\n"
385 << msg.str() << "\n"
386 << ss.str() << "\n"
387 << G4endl;
388
392 }
393 initializeStarted = true;
394 }
395 else
396 {
397 auto initCmdStack = GetCommandStack();
398 if(!initCmdStack.empty())
399 {
400 threadPool->execute_on_all_threads([initCmdStack]() {
401 for(auto& itr : initCmdStack)
402 G4UImanager::GetUIpointer()->ApplyCommand(itr);
403 });
404 }
405
406 // cleans up a previous run and events in case a thread
407 // does not execute any tasks
410
411 {
412 std::stringstream msg;
413 msg << "--> G4TaskRunManager::CreateAndStartWorkers() --> "
414 << "Creating " << numberOfTasks << " tasks with "
415 << numberOfEventsPerTask << " events/task...";
416
417 std::stringstream ss;
418 ss.fill('=');
419 ss << std::setw(msg.str().length()) << "";
420 G4cout << "\n"
421 << ss.str() << "\n"
422 << msg.str() << "\n"
423 << ss.str() << "\n"
424 << G4endl;
425 }
426
428 for(G4int nt = 0; nt < numberOfTasks + 1; ++nt)
429 {
430 if(remaining > 0)
431 AddEventTask(nt);
432 remaining -= numberOfEventsPerTask;
433 }
435 }
436}
std::vector< G4String > GetCommandStack()
static std::vector< G4String > & InitCommandStack()
virtual void AddEventTask(G4int)
virtual void ComputeNumberOfTasks()
virtual void DoWork() override
static G4WorkerTaskRunManager * GetWorkerRunManager()
void execute_on_all_threads(FuncT &&_func)
Definition: ThreadPool.hh:375
virtual void wait()
Definition: VTaskGroup.cc:81

Referenced by InitializeEventLoop().

◆ GetGrainsize()

G4int G4TaskRunManager::GetGrainsize ( ) const
inline

Definition at line 93 of file G4TaskRunManager.hh.

93{ return eventGrainsize; }

◆ GetMasterRunManager()

◆ GetMasterThreadId()

G4ThreadId G4TaskRunManager::GetMasterThreadId ( )
static

Definition at line 183 of file G4TaskRunManager.cc.

184{
186}
static G4ThreadId GetMasterThreadId()

◆ GetMTMasterRunManagerKernel()

G4TaskRunManagerKernel * G4TaskRunManager::GetMTMasterRunManagerKernel ( )
static

Definition at line 69 of file G4TaskRunManager.cc.

70{
71 return GetMasterRunManager()->MTkernel;
72}
static G4TaskRunManager * GetMasterRunManager()

◆ GetNumberActiveThreads()

virtual size_t G4TaskRunManager::GetNumberActiveThreads ( ) const
inlineoverridevirtual

Reimplemented from PTL::TaskRunManager.

Definition at line 105 of file G4TaskRunManager.hh.

106 {
108 }
virtual size_t GetNumberActiveThreads() const

◆ GetNumberOfEventsPerTask()

G4int G4TaskRunManager::GetNumberOfEventsPerTask ( ) const
inline

Definition at line 95 of file G4TaskRunManager.hh.

96 {
97 return numberOfEventsPerTask;
98 }

◆ GetNumberOfTasks()

G4int G4TaskRunManager::GetNumberOfTasks ( ) const
inline

Definition at line 94 of file G4TaskRunManager.hh.

94{ return numberOfTasks; }

◆ GetNumberOfThreads()

virtual G4int G4TaskRunManager::GetNumberOfThreads ( ) const
inlineoverridevirtual

Reimplemented from PTL::TaskRunManager.

Definition at line 101 of file G4TaskRunManager.hh.

102 {
104 }
virtual int GetNumberOfThreads() const

◆ Initialize() [1/2]

void G4TaskRunManager::Initialize ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 237 of file G4TaskRunManager.cc.

238{
239 G4bool firstTime = (!threadPool);
240 if(firstTime)
242
244
245 // make sure all worker threads are set up.
247 if(firstTime)
249 // G4UImanager::GetUIpointer()->SetIgnoreCmdNotFound(true);
250}
bool G4bool
Definition: G4Types.hh:86
virtual void Initialize()
void SetRunIDCounter(G4int i)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void InitializeThreadPool() override

◆ Initialize() [2/2]

virtual void G4TaskRunManager::Initialize ( uint64_t  nthreads)
inlineoverridevirtual

Reimplemented from PTL::TaskRunManager.

Definition at line 120 of file G4TaskRunManager.hh.

121 {
123 }
virtual void Initialize(uint64_t n=std::thread::hardware_concurrency())

◆ InitializeEventLoop()

void G4TaskRunManager::InitializeEventLoop ( G4int  n_event,
const char *  macroFile = nullptr,
G4int  n_select = -1 
)
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 477 of file G4TaskRunManager.cc.

479{
480 MTkernel->SetUpDecayChannels();
483
484 if(!fakeRun)
485 {
486 nSeedsUsed = 0;
487 nSeedsFilled = 0;
488
489 if(verboseLevel > 0)
490 timer->Start();
491
492 n_select_msg = n_select;
493 if(macroFile != nullptr)
494 {
495 if(n_select_msg < 0)
496 n_select_msg = n_event;
497
498 msgText = "/control/execute ";
499 msgText += macroFile;
500 selectMacro = macroFile;
501 }
502 else
503 {
504 n_select_msg = -1;
505 selectMacro = "";
506 }
507
509
510 // initialize seeds
511 // If user did not implement InitializeSeeds,
512 // use default: nSeedsPerEvent seeds per event
513 if(eventModuloDef > 0)
514 {
516 if(eventModulo > numberOfEventsPerTask)
517 {
518 G4int oldMod = eventModulo;
519 eventModulo = numberOfEventsPerTask;
520 if(eventModulo < 1)
521 eventModulo = 1;
522
524 msgd << "Event modulo is reduced to " << eventModulo << " (was "
525 << oldMod << ")"
526 << " to distribute events to all threads.";
527 G4Exception("G4TaskRunManager::InitializeEventLoop()", "Run10035",
528 JustWarning, msgd);
529 }
530 }
531 else
532 {
533 eventModulo = G4int(std::sqrt(G4double(numberOfEventsPerTask)));
534 if(eventModulo < 1)
535 eventModulo = 1;
536 }
537
538 if(n_event > 0)
539 {
540 G4bool _overload = InitializeSeeds(n_event);
541 G4bool _functor = false;
542 if(!_overload)
543 _functor = initSeedsCallback(n_event, nSeedsPerEvent, nSeedsFilled);
544 if(_overload == false && _functor == false)
545 {
548 {
549 case 0:
550 nSeedsFilled = n_event;
551 break;
552 case 1:
553 nSeedsFilled = numberOfEventsPerTask;
554 break;
555 case 2:
556 nSeedsFilled = n_event / eventModulo + 1;
557 break;
558 default:
560 msgd << "Parameter value <" << SeedOncePerCommunication()
561 << "> of seedOncePerCommunication is invalid. It is reset "
562 "to 0.";
563 G4Exception("G4TaskRunManager::InitializeEventLoop()", "Run10036",
564 JustWarning, msgd);
566 nSeedsFilled = n_event;
567 }
568
569 // Generates up to nSeedsMax seed pairs only.
572 masterRNGEngine->flatArray(nSeedsPerEvent * nSeedsFilled, randDbl);
573 helper->Fill(randDbl, nSeedsFilled, n_event, nSeedsPerEvent);
574 }
575 }
576 }
577
578 // Now initialize workers. Check if user defined a WorkerThreadInitialization
579 if(userWorkerThreadInitialization == nullptr)
581
582 // Prepare UI commands for threads
584
585 // Start worker threads
587}
virtual void flatArray(const int size, double *vect)=0
static G4int SeedOncePerCommunication()
static void SetSeedOncePerCommunication(G4int val)
virtual void PrepareCommandsStack()
G4Timer * timer
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
G4int n_select_msg
G4int numberOfEventProcessed
G4String msgText
G4String selectMacro
virtual void CreateAndStartWorkers() override
virtual G4bool InitializeSeeds(G4int) override
InitializeSeedsCallback initSeedsCallback
static G4TemplateRNGHelper< T > * GetInstance()
Definition: G4RNGHelper.cc:37
void Fill(G4double *dbl, G4int nev, G4int nev_tot, G4int nrpe)
Definition: G4RNGHelper.hh:77
void Start()

◆ InitializeSeeds()

virtual G4bool G4TaskRunManager::InitializeSeeds ( G4int  )
inlineoverrideprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 155 of file G4TaskRunManager.hh.

155{ return false; }

Referenced by InitializeEventLoop().

◆ InitializeThreadPool()

void G4TaskRunManager::InitializeThreadPool ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 254 of file G4TaskRunManager.cc.

255{
257 {
258 G4Exception("G4TaskRunManager::InitializeThreadPool", "Run1040",
259 JustWarning, "Threadpool already initialized. Ignoring...");
260 return;
261 }
262
263 std::stringstream ss;
264 ss.fill('=');
265 ss << std::setw(90) << "";
266 G4cout << "\n" << ss.str() << G4endl;
267
270
271 // create the joiners
272 if(threadPool->using_tbb())
273 {
274 G4cout << "G4TaskRunManager :: Using TBB..." << G4endl;
275 if(!workTaskGroup)
277 }
278 else
279 {
280 G4cout << "G4TaskRunManager :: Using G4ThreadPool..." << G4endl;
281 if(!workTaskGroup)
283 }
284
285 G4cout << ss.str() << "\n" << G4endl;
286}
G4TBBTaskGroup< void > RunTaskGroupTBB
G4TaskGroup< void > RunTaskGroup
int GetVerbose() const
void SetVerbose(int val)
static bool using_tbb()
Definition: ThreadPool.cc:92

Referenced by Initialize().

◆ MergeRun()

void G4TaskRunManager::MergeRun ( const G4Run localRun)

Definition at line 635 of file G4TaskRunManager.cc.

636{
637 G4AutoLock l(&runMergerMutex);
638 if(currentRun)
639 currentRun->Merge(localRun);
640}
G4Run * currentRun
virtual void Merge(const G4Run *)
Definition: G4Run.cc:64

◆ MergeScores()

void G4TaskRunManager::MergeScores ( const G4ScoringManager localScoringManager)

Definition at line 626 of file G4TaskRunManager.cc.

627{
628 G4AutoLock l(&scorerMergerMutex);
629 if(masterScM)
630 masterScM->Merge(localScoringManager);
631}
void Merge(const G4ScoringManager *scMan)

◆ NewActionRequest()

virtual void G4TaskRunManager::NewActionRequest ( WorkerActionRequest  )
inlineoverrideprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 205 of file G4TaskRunManager.hh.

205{}

◆ ProcessOneEvent()

void G4TaskRunManager::ProcessOneEvent ( G4int  i_event)
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 290 of file G4TaskRunManager.cc.

291{
292 // Nothing to do
293}

◆ RefillSeeds()

void G4TaskRunManager::RefillSeeds ( )
overrideprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 449 of file G4TaskRunManager.cc.

450{
452 G4int nFill = 0;
454 {
455 case 0:
457 break;
458 case 1:
459 nFill = numberOfEventsPerTask - nSeedsFilled;
460 break;
461 case 2:
462 default:
465 1;
466 }
467 // Generates up to nSeedsMax seed pairs only.
468 if(nFill > nSeedsMax)
469 nFill = nSeedsMax;
470 masterRNGEngine->flatArray(nSeedsPerEvent * nFill, randDbl);
471 helper->Refill(randDbl, nFill);
472 nSeedsFilled += nFill;
473}
void Refill(G4double *dbl, G4int nev)
Definition: G4RNGHelper.hh:90

Referenced by SetUpAnEvent(), and SetUpNEvents().

◆ RequestWorkersProcessCommandsStack()

void G4TaskRunManager::RequestWorkersProcessCommandsStack ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 764 of file G4TaskRunManager.cc.

765{
767
768 auto process_commands_stack = []() {
770 if(mrm)
771 {
772 auto cmds = mrm->GetCommandStack();
773 for(const auto& itr : cmds)
774 G4UImanager::GetUIpointer()->ApplyCommand(itr); // TLS instance
776 }
777 };
778
779 threadPool->execute_on_all_threads(process_commands_stack);
780}
virtual void ThisWorkerProcessCommandsStackDone()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485

Referenced by TerminateWorkers().

◆ RunTermination()

void G4TaskRunManager::RunTermination ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 591 of file G4TaskRunManager.cc.

592{
593 // Wait for all worker threads to have finished the run
594 // i.e. wait for them to return from RunTermination()
595 // This guarantee that userrunaction for workers has been called
596
597 // Wait now for all threads to finish event-loop
599 // Now call base-class methof
602}
virtual void RunTermination()
virtual void TerminateEventLoop()
virtual void WaitForEndEventLoopWorkers() override

◆ SetGrainsize()

void G4TaskRunManager::SetGrainsize ( G4int  n)
inline

Definition at line 92 of file G4TaskRunManager.hh.

92{ eventGrainsize = n; }

◆ SetInitializeSeedsCallback()

void G4TaskRunManager::SetInitializeSeedsCallback ( InitializeSeedsCallback  f)
inline

Definition at line 209 of file G4TaskRunManager.hh.

210 {
212 }

◆ SetNumberOfThreads()

void G4TaskRunManager::SetNumberOfThreads ( G4int  n)
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 199 of file G4TaskRunManager.cc.

200{
201 if(forcedNwokers > 0)
202 {
203 std::stringstream ss;
204 ss << "\n### Number of threads is forced to " << forcedNwokers
205 << " by G4FORCENUMBEROFTHREADS environment variable. G4TaskRunManager::"
206 << __FUNCTION__ << "(" << n << ") ignored ###";
207
208 if(verboseLevel > 1)
209 {
211 msg << ss.str();
212 G4Exception("G4TaskRunManager::SetNumberOfThreads(G4int)", "Run0132",
213 JustWarning, msg);
214 }
215 else
216 {
217 G4cout << ss.str() << "\n" << G4endl;
218 }
220 }
221 else
222 {
223 nworkers = n;
225 {
226 std::stringstream ss;
227 ss << "\n### Thread-pool already initialized. Resizing to " << nworkers
228 << "threads ###";
229 G4cout << ss.str() << "\n" << G4endl;
230 GetThreadPool()->resize(n);
231 }
232 }
233}
ThreadPool * GetThreadPool() const
void resize(size_type _n)
Definition: ThreadPool.hh:287

◆ SetUpAnEvent()

G4bool G4TaskRunManager::SetUpAnEvent ( G4Event evt,
G4long s1,
G4long s2,
G4long s3,
G4bool  reseedRequired = true 
)
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 644 of file G4TaskRunManager.cc.

646{
647 G4AutoLock l(&setUpEventMutex);
649 {
651 if(reseedRequired)
652 {
654 G4int idx_rndm = nSeedsPerEvent * nSeedsUsed;
655 s1 = helper->GetSeed(idx_rndm);
656 s2 = helper->GetSeed(idx_rndm + 1);
657 if(nSeedsPerEvent == 3)
658 s3 = helper->GetSeed(idx_rndm + 2);
659 ++nSeedsUsed;
661 RefillSeeds();
662 }
664 return true;
665 }
666 return false;
667}
void SetEventID(G4int i)
Definition: G4Event.hh:80
virtual void RefillSeeds() override
virtual const T GetSeed(const G4int &sdId)
Definition: G4RNGHelper.hh:58

◆ SetUpNEvents()

G4int G4TaskRunManager::SetUpNEvents ( G4Event evt,
G4SeedsQueue seedsQueue,
G4bool  reseedRequired = true 
)
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 671 of file G4TaskRunManager.cc.

673{
674 G4AutoLock l(&setUpEventMutex);
676 {
677 G4int nevt = numberOfEventsPerTask;
678 G4int nmod = eventModulo;
680 {
683 }
685 if(reseedRequired)
686 {
688 G4int nevRnd = nmod;
690 nevRnd = 1;
691 for(G4int i = 0; i < nevRnd; ++i)
692 {
693 seedsQueue->push(helper->GetSeed(nSeedsPerEvent * nSeedsUsed));
694 seedsQueue->push(helper->GetSeed(nSeedsPerEvent * nSeedsUsed + 1));
695 if(nSeedsPerEvent == 3)
696 seedsQueue->push(helper->GetSeed(nSeedsPerEvent * nSeedsUsed + 2));
697 nSeedsUsed++;
699 RefillSeeds();
700 }
701 }
703 return nevt;
704 }
705 return 0;
706}

◆ StoreRNGStatus()

void G4TaskRunManager::StoreRNGStatus ( const G4String filenamePrefix)
overrideprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 190 of file G4TaskRunManager.cc.

191{
192 std::ostringstream os;
193 os << randomNumberStatusDir << "G4Master_" << fn << ".rndm";
194 G4Random::saveEngineStatus(os.str().c_str());
195}
G4String randomNumberStatusDir

◆ TerminateOneEvent()

void G4TaskRunManager::TerminateOneEvent ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 297 of file G4TaskRunManager.cc.

298{
299 // Nothing to do
300}

◆ TerminateWorkers()

void G4TaskRunManager::TerminateWorkers ( )
overrideprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 710 of file G4TaskRunManager.cc.

711{
712 // Force workers to execute (if any) all UI commands left in the stack
714
715 if(workTaskGroup)
716 {
718 if(!fakeRun)
721 }
722}
virtual void RequestWorkersProcessCommandsStack() override

◆ ThisWorkerEndEventLoop()

virtual void G4TaskRunManager::ThisWorkerEndEventLoop ( )
inlineoverridevirtual

Reimplemented from G4MTRunManager.

Definition at line 198 of file G4TaskRunManager.hh.

198{}

◆ ThisWorkerProcessCommandsStackDone()

void G4TaskRunManager::ThisWorkerProcessCommandsStackDone ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 784 of file G4TaskRunManager.cc.

784{}

◆ ThisWorkerReady()

virtual void G4TaskRunManager::ThisWorkerReady ( )
inlineoverridevirtual

Reimplemented from G4MTRunManager.

Definition at line 197 of file G4TaskRunManager.hh.

197{}

◆ ThisWorkerWaitForNextAction()

virtual WorkerActionRequest G4TaskRunManager::ThisWorkerWaitForNextAction ( )
inlineoverridevirtual

Reimplemented from G4MTRunManager.

Definition at line 199 of file G4TaskRunManager.hh.

◆ ThreadPoolIsInitialized()

G4bool G4TaskRunManager::ThreadPoolIsInitialized ( ) const
inline

Definition at line 118 of file G4TaskRunManager.hh.

118{ return poolInitialized; }

◆ WaitForEndEventLoopWorkers()

void G4TaskRunManager::WaitForEndEventLoopWorkers ( )
overridevirtual

Reimplemented from G4MTRunManager.

Definition at line 751 of file G4TaskRunManager.cc.

Referenced by RunTermination().

◆ WaitForReadyWorkers()

virtual void G4TaskRunManager::WaitForReadyWorkers ( )
inlineoverridevirtual

Reimplemented from G4MTRunManager.

Definition at line 195 of file G4TaskRunManager.hh.

195{}

Friends And Related Function Documentation

◆ G4RunManagerFactory

friend class G4RunManagerFactory
friend

Definition at line 70 of file G4TaskRunManager.hh.

Member Data Documentation

◆ initSeedsCallback

InitializeSeedsCallback G4TaskRunManager::initSeedsCallback
protected
Initial value:
= [](G4int, G4int&, G4int&) {
return false;
}

Definition at line 238 of file G4TaskRunManager.hh.

Referenced by InitializeEventLoop(), and SetInitializeSeedsCallback().

◆ poolInitialized

G4bool& G4TaskRunManager::poolInitialized = PTL::TaskRunManager::m_is_initialized
protected

◆ taskManager

G4TaskManager*& G4TaskRunManager::taskManager = PTL::TaskRunManager::m_task_manager
protected

Definition at line 236 of file G4TaskRunManager.hh.

◆ taskQueue

G4VUserTaskQueue*& G4TaskRunManager::taskQueue = PTL::TaskRunManager::m_task_queue
protected

Definition at line 235 of file G4TaskRunManager.hh.

Referenced by G4TaskRunManager().

◆ threadPool

◆ workTaskGroup

RunTaskGroup* G4TaskRunManager::workTaskGroup = nullptr
protected

The documentation for this class was generated from the following files: