Import Geant4 10.7.0.beta source tree
This commit is contained in:
@@ -29,66 +29,68 @@
|
||||
// class description:
|
||||
//
|
||||
// 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.
|
||||
// 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.
|
||||
// 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.
|
||||
// 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.
|
||||
// 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.
|
||||
// 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.
|
||||
// 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.
|
||||
//
|
||||
|
||||
#ifndef G4UserWorkerInitialization_hh
|
||||
#define G4UserWorkerInitialization_hh
|
||||
|
||||
class G4UserWorkerInitialization {
|
||||
public: // with description
|
||||
G4UserWorkerInitialization();
|
||||
virtual ~G4UserWorkerInitialization();
|
||||
class G4UserWorkerInitialization
|
||||
{
|
||||
public: // with description
|
||||
G4UserWorkerInitialization();
|
||||
virtual ~G4UserWorkerInitialization();
|
||||
|
||||
virtual void WorkerInitialize() const;
|
||||
// This method is called after the tread is created but before the
|
||||
// G4WorkerRunManager is instantiated.
|
||||
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 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 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 has
|
||||
// finished but before the synchronization over threads.
|
||||
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 WorkerStop() const;
|
||||
// This method is called once at the end of simulation job.
|
||||
// Implement here a clean up action.
|
||||
|
||||
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 // G4UserWorkerInitialization_hh
|
||||
|
||||
Reference in New Issue
Block a user