35#ifndef G4TaskRunManager_hh
36#define G4TaskRunManager_hh 1
114 G4int n_select = -1)
override;
133 G4bool reseedRequired =
true)
override;
211 G4bool workersStarted =
false;
212 G4int eventGrainsize = 0;
213 G4int numberOfEventsPerTask = -1;
214 G4int numberOfTasks = -1;
_Tp G4GetEnv(const std::string &env_id, _Tp _default=_Tp())
std::queue< G4long > G4SeedsQueue
static G4MTRunManager * GetMasterRunManager()
G4int GetNumberOfThreads() const override
void ConstructScoringWorlds() override
void InitializeThreadPool() override
void ThisWorkerEndEventLoop() override
void CreateAndStartWorkers() override
G4bool InitializeSeeds(G4int) override
static G4TaskRunManager * GetMasterRunManager()
void ThisWorkerProcessCommandsStackDone() override
G4int SetUpNEvents(G4Event *, G4SeedsQueue *seedsQueue, G4bool reseedRequired=true) override
WorkerActionRequest ThisWorkerWaitForNextAction() override
G4TaskManager *& taskManager
G4VUserTaskQueue *& taskQueue
void SetNumberOfThreads(G4int n) override
void SetInitializeSeedsCallback(InitializeSeedsCallback f)
std::function< G4bool(G4int, G4int &, G4int &)> InitializeSeedsCallback
G4int GetNumberOfEventsPerTask() const
void AbortRun(G4bool softAbort=false) override
InitializeSeedsCallback initSeedsCallback
void RefillSeeds() override
void RequestWorkersProcessCommandsStack() override
G4int GetNumberOfTasks() const
virtual void AddEventTask(G4int)
static G4ThreadId GetMasterThreadId()
G4int GetGrainsize() const
void TerminateOneEvent() override
RunTaskGroup * workTaskGroup
void TerminateWorkers() override
void AbortEvent() override
~G4TaskRunManager() override
size_t GetNumberActiveThreads() const override
void InitializeEventLoop(G4int n_event, const char *macroFile=nullptr, G4int n_select=-1) override
void WaitForReadyWorkers() override
void SetGrainsize(G4int n)
void Initialize() override
void StoreRNGStatus(const G4String &filenamePrefix) override
void ThisWorkerReady() override
void RunTermination() override
void MergeScores(const G4ScoringManager *localScoringManager)
void WaitForEndEventLoopWorkers() override
G4ThreadPool *& threadPool
static G4TaskRunManagerKernel * GetMTMasterRunManagerKernel()
G4bool ThreadPoolIsInitialized() const
void ProcessOneEvent(G4int i_event) override
void MergeRun(const G4Run *localRun)
void Initialize(uint64_t nthreads) override
void NewActionRequest(WorkerActionRequest) override
virtual void ComputeNumberOfTasks()
G4TaskRunManager(G4bool useTBB=G4GetEnv< G4bool >("G4USE_TBB", false))
G4bool SetUpAnEvent(G4Event *, G4long &s1, G4long &s2, G4long &s3, G4bool reseedRequired=true) override
TaskManager * m_task_manager
virtual void Initialize(uint64_t n=std::thread::hardware_concurrency())
ThreadPool * m_thread_pool
VUserTaskQueue * m_task_queue
virtual size_t GetNumberActiveThreads() const