Import Geant4 11.0.0.beta source tree
This commit is contained in:
@@ -23,74 +23,75 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// G4UserWorkerInitialization
|
||||
//
|
||||
// 25 Feb 2013: Andrea Dotti, first implementation
|
||||
// Class description:
|
||||
//
|
||||
// class description:
|
||||
// This class is used for multi-threading.
|
||||
// The object of this class can be set to G4MTRunManager, but not to
|
||||
// G4RunManager. G4UserWorkerInitialization class has five virtual methods
|
||||
// as the user hooks which are invoked at several occasions in the life
|
||||
// cycle of each thread.
|
||||
//
|
||||
// This class is used for multi-threaded Geant4.
|
||||
// The object of this class can be set to G4MTRunManager, but not to
|
||||
// G4RunManager. G4UserWorkerInitialization class has five virtual methods
|
||||
// as the user hooks which are invoked at several occasions of the life
|
||||
// cycle of each thread.
|
||||
//
|
||||
// - virtual void WorkerInitialize() const
|
||||
// This method is called after the tread is created but before the
|
||||
// G4WorkerRunManager is instantiated.
|
||||
// - virtual void WorkerStart() const
|
||||
// This method is called once at the beginning of simulation job when
|
||||
// kernel classes and user action classes have already instantiated but
|
||||
// geometry and physics have not been yet initialized. This situation is
|
||||
// identical to "PreInit" state in the sequential mode.
|
||||
// - virtual void WorkerRunStart() const
|
||||
// This method is called before an event loop. Geometry and physics have
|
||||
// already been set up for the thread. All threads are synchronized and
|
||||
// ready to start the local event loop. This situation is identical to
|
||||
// "Idle" state in the sequential mode.
|
||||
// - virtual void WorkerRunEnd() const
|
||||
// This method is called for each thread when the local event loop is
|
||||
// done, but before the synchronization over threads.
|
||||
// - virtual void WorkerStop() const
|
||||
// This method is called once at the end of simulation job.
|
||||
//
|
||||
// Note: This object should be instantiated only once and set to
|
||||
// G4MTRunManager,
|
||||
// while these five methods are invoked for each worker thread. Thus, to
|
||||
// store thread-local objects, use G4ThreadLocal keyword.
|
||||
// - virtual void WorkerInitialize() const
|
||||
// This method is called after the tread is created but before the
|
||||
// G4WorkerRunManager is instantiated.
|
||||
// - virtual void WorkerStart() const
|
||||
// This method is called once at the beginning of simulation job when
|
||||
// kernel classes and user action classes have already instantiated but
|
||||
// geometry and physics have not been yet initialised. This situation is
|
||||
// identical to the 'PreInit' state in the sequential mode.
|
||||
// - virtual void WorkerRunStart() const
|
||||
// This method is called before an event loop. Geometry and physics have
|
||||
// already been set up for the thread. All threads are synchronised and
|
||||
// ready to start the local event loop. This situation is identical to
|
||||
// 'Idle' state in the sequential mode.
|
||||
// - virtual void WorkerRunEnd() const
|
||||
// This method is called for each thread when the local event loop is
|
||||
// done, but before the synchronisation over threads.
|
||||
// - virtual void WorkerStop() const
|
||||
// This method is called once at the end of the simulation job.
|
||||
//
|
||||
// Note: this object should be instantiated only once and set to
|
||||
// G4MTRunManager, while the five methods above are invoked for each
|
||||
// worker thread. Thus, to store thread-local objects, use the
|
||||
// G4ThreadLocal keyword.
|
||||
|
||||
// Author: A.Dotti (SLAC), 25 February 2013
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4UserWorkerInitialization_hh
|
||||
#define G4UserWorkerInitialization_hh
|
||||
#define G4UserWorkerInitialization_hh 1
|
||||
|
||||
class G4UserWorkerInitialization
|
||||
{
|
||||
public: // with description
|
||||
G4UserWorkerInitialization();
|
||||
virtual ~G4UserWorkerInitialization();
|
||||
public:
|
||||
|
||||
virtual void WorkerInitialize() const;
|
||||
// This method is called after the tread is created but before the
|
||||
// G4WorkerRunManager is instantiated.
|
||||
G4UserWorkerInitialization();
|
||||
virtual ~G4UserWorkerInitialization();
|
||||
|
||||
virtual void WorkerStart() const;
|
||||
// This method is called once at the beginning of simulation job
|
||||
// when kernel classes and user action classes have already instantiated
|
||||
// but geometry and physics have not been yet initialized. This situation
|
||||
// is identical to "PreInit" state in the sequential mode.
|
||||
virtual void WorkerInitialize() const;
|
||||
// This method is called after the tread is created but before the
|
||||
// G4WorkerRunManager is instantiated.
|
||||
|
||||
virtual void WorkerRunStart() const;
|
||||
// This method is called before an event loop. Geometry and physics have
|
||||
// already been set up for the thread. All threads are synchronized and
|
||||
// ready to start the local event loop. This situation is identical to
|
||||
// "Idle" state in the sequential mode.
|
||||
virtual void WorkerStart() const;
|
||||
// This method is called once at the beginning of simulation job
|
||||
// when kernel classes and user action classes have already instantiated
|
||||
// but geometry and physics have not been yet initialised. This situation
|
||||
// is identical to 'PreInit' state in the sequential mode.
|
||||
|
||||
virtual void WorkerRunEnd() const;
|
||||
// This method is called for each thread, when the local event loop has
|
||||
// finished but before the synchronization over threads.
|
||||
virtual void WorkerRunStart() const;
|
||||
// This method is called before an event loop. Geometry and physics have
|
||||
// already been set up for the thread. All threads are synchronised and
|
||||
// ready to start the local event loop. This situation is identical to
|
||||
// 'Idle' state in the sequential mode.
|
||||
|
||||
virtual void WorkerStop() const;
|
||||
// This method is called once at the end of simulation job.
|
||||
// Implement here a clean up action.
|
||||
virtual void WorkerRunEnd() const;
|
||||
// This method is called for each thread, when the local event loop has
|
||||
// finished but before the synchronisation over threads.
|
||||
|
||||
virtual void WorkerStop() const;
|
||||
// This method is called once at the end of simulation job.
|
||||
// Implement here a clean up action.
|
||||
};
|
||||
|
||||
#endif // G4UserWorkerInitialization_hh
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user