Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleTbbMasterRunManager Class Reference

#include <SimpleTbbMasterRunManager.hh>

Inheritance diagram for SimpleTbbMasterRunManager:
Collaboration diagram for SimpleTbbMasterRunManager:

Public Member Functions

 SimpleTbbMasterRunManager ()
 
virtual ~SimpleTbbMasterRunManager ()
 
virtual void RunTermination ()
 
void SetTaskList (tbb::task_list *tl)
 
void SetNumberEventsPerTask (G4int nt)
 
- Public Member Functions inherited from G4MTRunManager
 G4MTRunManager ()
 
virtual ~G4MTRunManager ()
 
void SetNumberOfThreads (G4int n)
 
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 TerminateOneEvent ()
 
virtual void ProcessOneEvent (G4int i_event)
 
virtual void ConstructScoringWorlds ()
 
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 ()
 
size_t GetNumberActiveThreads () const
 
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 ()
 
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 DefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
 
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 TerminateEventLoop ()
 
virtual G4EventGenerateEvent (G4int i_event)
 
virtual void AnalyzeEvent (G4Event *anEvent)
 
void DumpRegion (const G4String &rname) const
 
void DumpRegion (G4Region *region=0) const
 
virtual void rndmSaveThisRun ()
 
virtual void rndmSaveThisEvent ()
 
virtual void RestoreRandomNumberStatus (const G4String &fileN)
 
const G4VUserDetectorConstructionGetUserDetectorConstruction () const
 
const G4VUserPhysicsListGetUserPhysicsList () const
 
const G4VUserActionInitializationGetUserActionInitialization () const
 
G4VUserActionInitializationGetNonConstUserActionInitialization () const
 
const G4UserWorkerInitializationGetUserWorkerInitialization () const
 
const
G4UserWorkerThreadInitialization
GetUserWorkerThreadInitialization () const
 
const G4UserRunActionGetUserRunAction () const
 
const
G4VUserPrimaryGeneratorAction
GetUserPrimaryGeneratorAction () 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 RestoreRndmEachEvent (G4bool)
 

Protected Member Functions

virtual void CreateAndStartWorkers ()
 
virtual void TerminateWorkers ()
 
virtual void CreateTask (G4int id, G4int evts)
 
virtual void WaitForReadyWorkers ()
 
virtual void WaitForEndEventLoopWorkers ()
 
virtual void ThisWorkerReady ()
 
virtual void ThisWorkerEndEventLoop ()
 
virtual WorkerActionRequest ThisWorkerWaitForNextAction ()
 
virtual void NewActionRequest (WorkerActionRequest)
 
- Protected Member Functions inherited from G4MTRunManager
virtual G4bool InitializeSeeds (G4int)
 
virtual void PrepareCommandsStack ()
 
virtual void StoreRNGStatus (const G4String &filenamePrefix)
 
void RefillSeeds ()
 
- Protected Member Functions inherited from G4RunManager
void CleanUpPreviousEvents ()
 
void CleanUpUnnecessaryEvents (G4int keepNEvents)
 
void StackPreviousEvent (G4Event *anEvent)
 
 G4RunManager (RMType rmType)
 
void UpdateScoring ()
 
virtual void DeleteUserInitializations ()
 

Additional Inherited Members

- Public Types inherited from G4MTRunManager
enum  WorkerActionRequest { WorkerActionRequest::UNDEFINED, WorkerActionRequest::NEXTITERATION, WorkerActionRequest::PROCESSUI, WorkerActionRequest::ENDWORKER }
 
typedef std::map< G4int,
G4VPhysicalVolume * > 
masterWorlds_t
 
- Public Types inherited from G4RunManager
enum  RMType { sequentialRM, masterRM, workerRM }
 
- Static Public Member Functions inherited from G4MTRunManager
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 Public Member Functions inherited from G4RunManager
static G4RunManagerGetRunManager ()
 
static G4bool IfGeometryHasBeenDestroyed ()
 
- Protected Attributes inherited from G4MTRunManager
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
 
RMType runManagerType
 
- Static Protected Attributes inherited from G4MTRunManager
static G4int seedOncePerCommunication = 0
 
- Static Protected Attributes inherited from G4RunManager
static G4bool fGeometryHasBeenDestroyed = false
 

Detailed Description

Definition at line 48 of file SimpleTbbMasterRunManager.hh.

Constructor & Destructor Documentation

SimpleTbbMasterRunManager::SimpleTbbMasterRunManager ( )

Definition at line 45 of file SimpleTbbMasterRunManager.cc.

45  :
47  theTasks(static_cast<tbb::task_list*>(0)),
48  nEvtsPerTask(1)
49 {
50 }
SimpleTbbMasterRunManager::~SimpleTbbMasterRunManager ( )
virtual

Definition at line 52 of file SimpleTbbMasterRunManager.cc.

53 {
54 }

Member Function Documentation

void SimpleTbbMasterRunManager::CreateAndStartWorkers ( )
protectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 61 of file SimpleTbbMasterRunManager.cc.

62 {
63  //Instead of pthread based workers, create tbbTask
64  G4int ntasks = numberOfEventToBeProcessed/nEvtsPerTask;
65  G4int remn = numberOfEventToBeProcessed % nEvtsPerTask;
66  for ( G4int nt = 0 ; nt < ntasks ; ++nt )
67  {
68  G4int evts= nEvtsPerTask;
69  if ( nt == ntasks - 1 ) evts+=remn;
70  CreateTask(nt,evts);
71  }
72 }
int G4int
Definition: G4Types.hh:78
virtual void CreateTask(G4int id, G4int evts)
G4int numberOfEventToBeProcessed

Here is the call graph for this function:

void SimpleTbbMasterRunManager::CreateTask ( G4int  id,
G4int  evts 
)
protectedvirtual

Definition at line 74 of file SimpleTbbMasterRunManager.cc.

75 {
76  tbbTask& task = * new(tbb::task::allocate_root())
77  tbbTask( id , NULL , evts ); //Add output for merging
78  theTasks->push_back( task );
79 }

Here is the caller graph for this function:

virtual void SimpleTbbMasterRunManager::NewActionRequest ( WorkerActionRequest  )
inlineprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 77 of file SimpleTbbMasterRunManager.hh.

77 {}
void SimpleTbbMasterRunManager::RunTermination ( )
virtual

Reimplemented from G4MTRunManager.

Definition at line 81 of file SimpleTbbMasterRunManager.cc.

82 {
83  // Reduce results ....
85 }
virtual void RunTermination()

Here is the call graph for this function:

void SimpleTbbMasterRunManager::SetNumberEventsPerTask ( G4int  nt)
inline

Definition at line 60 of file SimpleTbbMasterRunManager.hh.

60 { nEvtsPerTask = nt; }

Here is the caller graph for this function:

void SimpleTbbMasterRunManager::SetTaskList ( tbb::task_list *  tl)
inline

Definition at line 57 of file SimpleTbbMasterRunManager.hh.

57 { theTasks = tl; }

Here is the caller graph for this function:

void SimpleTbbMasterRunManager::TerminateWorkers ( )
protectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 56 of file SimpleTbbMasterRunManager.cc.

57 {
58  //For TBB based example this should be empty
59 }
virtual void SimpleTbbMasterRunManager::ThisWorkerEndEventLoop ( )
inlineprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 74 of file SimpleTbbMasterRunManager.hh.

74 {}
virtual void SimpleTbbMasterRunManager::ThisWorkerReady ( )
inlineprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 73 of file SimpleTbbMasterRunManager.hh.

73 {}
virtual WorkerActionRequest SimpleTbbMasterRunManager::ThisWorkerWaitForNextAction ( )
inlineprotectedvirtual
virtual void SimpleTbbMasterRunManager::WaitForEndEventLoopWorkers ( )
inlineprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 72 of file SimpleTbbMasterRunManager.hh.

72 {}
virtual void SimpleTbbMasterRunManager::WaitForReadyWorkers ( )
inlineprotectedvirtual

Reimplemented from G4MTRunManager.

Definition at line 71 of file SimpleTbbMasterRunManager.hh.

71 {}

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