Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4WorkerRunManager.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 
28 #include "G4WorkerRunManager.hh"
30 #include "G4UImanager.hh"
32 #include "G4MTRunManager.hh"
33 #include "G4ScoringManager.hh"
36 #include "G4WorkerThread.hh"
37 #include "G4VUserPhysicsList.hh"
41 #include "G4UserRunAction.hh"
42 #include "G4RNGHelper.hh"
43 #include "G4Run.hh"
45 #include "G4VVisManager.hh"
46 #include "G4SDManager.hh"
47 #include "G4VScoringMesh.hh"
48 #include "G4Timer.hh"
49 #include "G4TiMemory.hh"
50 #include <sstream>
51 #include <fstream>
52 
54 { return static_cast<G4WorkerRunManager*>(G4RunManager::GetRunManager()); }
55 
57 { return static_cast<G4WorkerRunManagerKernel*>(GetWorkerRunManager()->kernel); }
58 
60  //This constructor should never be called in non-multithreaded mode
61 #ifndef G4MULTITHREADED
63  msg<<"Geant4 code is compiled without multi-threading support (-DG4MULTITHREADED is set to off).";
64  msg<<" This type of RunManager can only be used in mult-threaded applications.";
65  G4Exception("G4WorkerRunManager::G4WorkerRunManager()","Run0103",FatalException,msg);
66 #endif
69  if(masterScM) G4ScoringManager::GetScoringManager(); //TLS instance for a worker
70 
71  eventLoopOnGoing = false;
72  runIsSeeded = false;
73  nevModulo = -1;
74  currEvID = -1;
75  workerContext = 0;
76  readStatusFromFile = false;
77 
79 
80 #ifdef G4MULTITHREADED
82  if(pVVis)
83  {
84  pVVis->SetUpForAThread();
85  visIsSetUp = true;
86  }
87  else
88  { visIsSetUp = false; }
89 #endif
90 }
91 
92 #include "G4MTRunManager.hh"
93 
95  // Delete thread-local data process manager objects
97 // physicsList->RemoveProcessManager();
98 
99  //Put these pointers to zero: owned by master thread
100  //If not to zero, the base class destructor will attempt to
101  //delete them
102  userDetector = 0;
106  physicsList = 0;
107  if(verboseLevel>0) G4cout<<"Destroying WorkerRunManager ("<<this<<")"<<G4endl;
108 }
109 
110 
112  if(!userDetector)
113  {
114  G4Exception("G4RunManager::InitializeGeometry", "Run0033",
115  FatalException, "G4VUserDetectorConstruction is not defined!");
116  return;
117  }
120 
121  //Step1: Get pointer to the physiWorld (note: needs to get the "super pointer, i.e. the one shared by all threads"
123  G4VPhysicalVolume* worldVol = masterKernel->GetCurrentWorld();
124  //Step2:, Call a new "WorkerDefineWorldVolume( pointer from 2-, false);
125  kernel->WorkerDefineWorldVolume(worldVol,false);
127  //Step3: Call user's ConstructSDandField()
130  geometryInitialized = true;
131 }
132 
134 
136 {
138 #ifdef G4MULTITHREADED
139  if(!visIsSetUp)
140  {
142  if(pVVis)
143  {
144  pVVis->SetUpForAThread();
145  visIsSetUp = true;
146  }
147  }
148 #endif
149 
150  if(!(kernel->RunInitialization(fakeRun))) return;
151 
152  //Signal this thread can start event loop.
153  //Note this will return only when all threads reach this point
155  if(fakeRun) return;
156 
157  const G4UserWorkerInitialization* uwi
160  if(currentRun) delete currentRun;
161  currentRun = 0;
162 
164  //Call a user hook: this is guaranteed all threads are "synchronized"
165  if(uwi) uwi->WorkerRunStart();
166 
168  if(!currentRun) currentRun = new G4Run();
169 
172 
175  if(fSDM)
176  { currentRun->SetHCtable(fSDM->GetHCtable()); }
177 
178  std::ostringstream oss;
179  G4Random::saveFullState(oss);
180  randomNumberStatusForThisRun = oss.str();
182 
183  for(G4int i_prev=0;i_prev<n_perviousEventsToBeStored;i_prev++)
184  { previousEvents->push_back((G4Event*)0); }
185 
186  if(printModulo>0 || verboseLevel>0)
187  {
188  G4cout << "### Run " << currentRun->GetRunID() << " starts on worker thread "
189  << G4Threading::G4GetThreadId() << "." << G4endl;
190  }
192 
194  G4String fileN = "currentRun";
195  if ( rngStatusEventsFlag ) {
196  std::ostringstream os;
197  os << "run" << currentRun->GetRunID();
198  fileN = os.str();
199  }
200  StoreRNGStatus(fileN);
201  }
202 
203  runAborted = false;
205 }
206 
207 void G4WorkerRunManager::DoEventLoop(G4int n_event, const char* macroFile , G4int n_select)
208 {
211  {
212  G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
213  "G4VUserPrimaryGeneratorAction is not defined!");
214  }
215 
216  //This is the same as in the sequential case, just the for-loop indexes are
217  //different
218  InitializeEventLoop(n_event,macroFile,n_select);
219 
220  // Reset random number seeds queue
221  while(seedsQueue.size()>0)
222  { seedsQueue.pop(); }
223  // for each run, worker should receive at least one set of random number seeds.
224  runIsSeeded = false;
225 
226  // Event loop
227  eventLoopOnGoing = true;
229  G4int i_event = -1;
230  nevModulo = -1;
231  currEvID = -1;
232 
233  while(eventLoopOnGoing)
234  {
235  ProcessOneEvent(i_event);
236  if(eventLoopOnGoing)
237  {
239  if(runAborted)
240  { eventLoopOnGoing = false; }
246  }
247  }
248 
250 }
251 
253 {
255  currentEvent = GenerateEvent(i_event);
256  if(eventLoopOnGoing)
257  {
260  UpdateScoring();
262  }
263 }
264 
266 {
268  G4Event* anEvent = new G4Event(i_event);
269  long s1 = 0;
270  long s2 = 0;
271  long s3 = 0;
272  G4bool eventHasToBeSeeded = true;
274  { eventHasToBeSeeded = false; }
275 
276  if(i_event<0)
277  {
279  if(nevM==1)
280  {
282  ->SetUpAnEvent(anEvent,s1,s2,s3,eventHasToBeSeeded);
283  runIsSeeded = true;
284  }
285  else
286  {
287  if(nevModulo<=0)
288  {
290  ->SetUpNEvents(anEvent,&seedsQueue,eventHasToBeSeeded);
291  if(nevToDo==0)
292  { eventLoopOnGoing = false; }
293  else
294  {
295  currEvID = anEvent->GetEventID();
296  nevModulo = nevToDo - 1;
297  }
298  }
299  else
300  {
301  if(G4MTRunManager::SeedOncePerCommunication()>0) eventHasToBeSeeded = false;
302  anEvent->SetEventID(++currEvID);
303  nevModulo--;
304  }
305  if(eventLoopOnGoing && eventHasToBeSeeded)
306  {
307  s1 = seedsQueue.front(); seedsQueue.pop();
308  s2 = seedsQueue.front(); seedsQueue.pop();
309  }
310  }
311 
312  if(!eventLoopOnGoing)
313  {
314  delete anEvent;
315  return 0;
316  }
317  }
318  else if(eventHasToBeSeeded)
319  {
320  //Need to reseed random number generator
322  s1 = helper->GetSeed(i_event*2);
323  s2 = helper->GetSeed(i_event*2+1);
324  }
325 
326  if(eventHasToBeSeeded)
327  {
328  long seeds[3] = { s1, s2, 0 };
329  G4Random::setTheSeeds(seeds,-1);
330  runIsSeeded = true;
332  }
333 
334  //Read from file seed.
335  //Andrea Dotti 4 November 2015
336  //This is required for strong-reproducibility, in MT mode we have that each
337  //thread produces, for each event a status file, we want to do that.
338  //Search a random file with the format run{%d}evt{%d}.rndm
339 
340  //This is the filename base constructed from run and event
341  const auto filename = [&] {
342  std::ostringstream os;
343  os << "run"<<currentRun->GetRunID() << "evt" << anEvent->GetEventID();
344  return os.str();
345  };
346 
347  G4bool RNGstatusReadFromFile = false;
348  if ( readStatusFromFile ) {
349  //Build full path of RNG status file for this event
350  std::ostringstream os;
351  os << filename() << ".rndm";
352  const G4String& randomStatusFile = os.str();
353  std::ifstream ifile(randomStatusFile.c_str());
354  if ( ifile ) { //File valid and readable
355  RNGstatusReadFromFile = true;
356  G4Random::restoreEngineStatus(randomStatusFile.c_str());
357  }
358  }
359 
360 
362  {
363  std::ostringstream oss;
364  G4Random::saveFullState(oss);
365  randomNumberStatusForThisEvent = oss.str();
367  }
368 
369  if(storeRandomNumberStatus && ! RNGstatusReadFromFile ) { //If reading from file, avoid to rewrite the same
370  G4String fileN = "currentEvent";
371  if ( rngStatusEventsFlag ) {
372  fileN = filename();
373  }
374  StoreRNGStatus(fileN);
375  }
376 
377  if(printModulo > 0 && anEvent->GetEventID()%printModulo == 0 )
378  {
379  G4cout << "--> Event " << anEvent->GetEventID() << " starts";
380  if(eventHasToBeSeeded)
381  { G4cout << " with initial seeds (" << s1 << "," << s2 << ")"; }
382  G4cout << "." << G4endl;
383  }
385  return anEvent;
386 }
387 
389 {
390  //Merge partial results into global run
393  if(ScM) mtRM->MergeScores(ScM);
394  mtRM->MergeRun(currentRun);
395 }
396 
398 {
399  if(!fakeRun)
400  {
402 
403  //Call a user hook: note this is before the next barrier
404  //so threads execute this method asyncrhonouzly
405  //(TerminateRun allows for synch via G4RunAction::EndOfRun)
406  const G4UserWorkerInitialization* uwi
408  if(uwi) uwi->WorkerRunEnd();
409  }
410 
412  //Signal this thread has finished envent-loop.
413  //Note this will return only whan all threads reach this point
415 
416 }
417 
419 {
420  if(verboseLevel>0 && !fakeRun)
421  {
422  timer->Stop();
423  G4cout << "Thread-local run terminated." << G4endl;
424  G4cout << "Run Summary" << G4endl;
425  if(runAborted)
426  { G4cout << " Run Aborted after " << numberOfEventProcessed << " events processed." << G4endl; }
427  else
428  { G4cout << " Number of events processed : " << numberOfEventProcessed << G4endl; }
429  G4cout << " " << *timer << G4endl;
430  }
431 }
432 
433 /****************************
434 void G4WorkerRunManager::BeamOn(G4int n_event,const char* macroFile,G4int n_select)
435 {
436  if(n_event>0)
437  { G4RunManager::BeamOn(n_event,macroFile,n_select); }
438  else
439  {
440  // fake BeamOn.
441  G4MTRunManager::GetMasterRunManager()->ThisWorkerReady();
442  G4MTRunManager::GetMasterRunManager()->ThisWorkerEndEventLoop();
443  }
444 }
445 ******************************/
446 
447 #include "G4AutoLock.hh"
448 namespace { G4Mutex ConstructScoringWorldsMutex = G4MUTEX_INITIALIZER; }
450 {
451  // Return if unnecessary
453  if(!ScM) return;
454  G4int nPar = ScM->GetNumberOfMesh();
455  if(nPar<1) return;
456 
457  // Update thread-local G4TransportationManager of all the world volumes
459 
461  assert( masterScM != NULL );
462 
465 
466  for(G4int iw=0;iw<nPar;iw++)
467  {
468  G4VScoringMesh* mesh = ScM->GetMesh(iw);
470  G4VPhysicalVolume* pWorld
472  ->IsWorldExisting(ScM->GetWorldName(iw));
473  if(!pWorld)
474  {
476  ed<<"Mesh name <"<<ScM->GetWorldName(iw)<<"> is not found in the master thread.";
477  G4Exception("G4WorkerRunManager::ConstructScoringWorlds()","RUN79001",
478  FatalException,ed);
479  }
480  if(!(mesh->GetMeshElementLogical()))
481  {
482  G4AutoLock l(&ConstructScoringWorldsMutex);
483  G4VScoringMesh* masterMesh = masterScM->GetMesh(iw);
484  mesh->SetMeshElementLogical(masterMesh->GetMeshElementLogical());
485  l.unlock();
486 
487  G4ParallelWorldProcess* theParallelWorldProcess = mesh->GetParallelWorldProcess();
488  if(theParallelWorldProcess)
489  { theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw)); }
490  else
491  {
492  theParallelWorldProcess = new G4ParallelWorldProcess(ScM->GetWorldName(iw));
493  mesh->SetParallelWorldProcess(theParallelWorldProcess);
494  theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw));
495 
496  particleIterator->reset();
497  while( (*particleIterator)() ){
498  G4ParticleDefinition* particle = particleIterator->value();
499  G4ProcessManager* pmanager = particle->GetProcessManager();
500  if(pmanager)
501  {
502  pmanager->AddProcess(theParallelWorldProcess);
503  if(theParallelWorldProcess->IsAtRestRequired(particle))
504  { pmanager->SetProcessOrdering(theParallelWorldProcess, idxAtRest, 9900); }
505  pmanager->SetProcessOrderingToSecond(theParallelWorldProcess, idxAlongStep);
506  pmanager->SetProcessOrdering(theParallelWorldProcess, idxPostStep, 9900);
507  } //if(pmanager)
508  }//while
509  }
510  }
511  mesh->WorkerConstruct(pWorld);
512  }
513 }
514 
516 {
517  G4Exception("G4RunManager::SetUserInitialization(G4UserWorkerInitialization*)", "Run0118",
518  FatalException, "This method should be used only with an instance of G4MTRunManager");
519 }
520 
522 {
523  G4Exception("G4RunManager::SetUserInitialization(G4UserWorkerThreadInitialization*)", "Run0119",
524  FatalException, "This method should be used only with an instance of G4MTRunManager");
525 }
526 
528 {
529  G4Exception("G4RunManager::SetUserInitialization(G4VUserActionInitialization*)", "Run0120",
530  FatalException, "This method should be used only with an instance of G4MTRunManager");
531 }
532 
534 {
535  G4Exception("G4RunManager::SetUserInitialization(G4VUserDetectorConstruction*)", "Run0121",
536  FatalException, "This method should be used only with an instance of G4MTRunManager");
537 }
538 
540 {
541  pl->InitializeWorker();
543 }
544 
546 {
547  G4RunManager::SetUserAction(userAction);
548  if(userAction) userAction->SetMaster(false);
549 }
550 
552 {
554  assert(mrnge);//Master has created RNG
557  uwti->SetupRNGEngine(mrnge);
558 }
559 
560 
561 //Forward calls (avoid GCC compilation warnings)
563 {
565 }
566 
568 {
570 }
571 
573 {
575 }
576 
578 {
580 }
581 
583 {
585 }
586 
588 {
589  std::ostringstream os;
590  os << randomNumberStatusDir << "G4Worker"<<workerContext->GetThreadId()<<"_"<<fn <<".rndm";
591  G4Random::saveEngineStatus(os.str().c_str());
592 }
593 
595 {
600  {
601  if( nextAction == G4MTRunManager::WorkerActionRequest::NEXTITERATION ) // start the next run
602  {
603  //The following code deals with changing materials between runs
604  static G4ThreadLocal G4bool skipInitialization = true;
605  if(skipInitialization)
606  {
607  // re-initialization is not necessary for the first run
608  skipInitialization = false;
609  }
610  else
611  {
612 // ReinitializeGeometry();
614  }
615 
616  // Execute UI commands stored in the master UI manager
617  std::vector<G4String> cmds = mrm->GetCommandStack();
618  G4UImanager* uimgr = G4UImanager::GetUIpointer(); //TLS instance
619  std::vector<G4String>::const_iterator it = cmds.begin();
620  for(;it!=cmds.end();it++)
621  { uimgr->ApplyCommand(*it); }
622  //Start this run
623  G4int numevents = mrm->GetNumberOfEventsToBeProcessed();
624  G4String macroFile = mrm->GetSelectMacro();
625  G4int numSelect = mrm->GetNumberOfSelectEvents();
626  if ( macroFile == "" || macroFile == " " )
627  {
628  this->BeamOn(numevents);
629  }
630  else
631  {
632  this->BeamOn(numevents,macroFile,numSelect);
633  }
634  }
635  else if (nextAction == G4MTRunManager::WorkerActionRequest::PROCESSUI ) {
636  std::vector<G4String> cmds = mrm->GetCommandStack();
637  G4UImanager* uimgr = G4UImanager::GetUIpointer(); //TLS instance
638  std::vector<G4String>::const_iterator it = cmds.begin();
639  for(;it!=cmds.end();it++)
640  { uimgr->ApplyCommand(*it); }
642  }
643  else
644  {
646  d<<"Cannot continue, this worker has been requested an unknwon action: "
647  <<static_cast<std::underlying_type<G4MTRunManager::WorkerActionRequest>::type>(nextAction);
648  G4Exception("G4WorkerRunManager::DoWork","Run0104",FatalException,d);
649  }
650 
651  //Now wait for master thread to signal new action to be performed
652  nextAction = mrm->ThisWorkerWaitForNextAction();
653  } //No more actions to perform
654 
655  return;
656 }
G4bool RunInitialization(G4bool fakeRun=false)
G4VUserDetectorConstruction * userDetector
static G4MTRunManager * GetMasterRunManager()
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:80
G4String msgText
virtual void SetupRNGEngine(const CLHEP::HepRandomEngine *aRNGEngine) const
G4Event * currentEvent
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
G4bool rngStatusEventsFlag
G4VUserActionInitialization * userActionInitialization
void SetHCtable(G4HCtable *HCtbl)
Definition: G4Run.hh:99
static G4ParticleTable * GetParticleTable()
G4int GetEventID() const
Definition: G4Event.hh:151
G4VPhysicalVolume * GetCurrentWorld() const
size_t GetNumberOfMesh() const
virtual void BeginOfRunAction(const G4Run *aRun)
void SetDCtable(G4DCtable *DCtbl)
Definition: G4Run.hh:101
G4int GetNumberOfParallelWorld() const
static G4WorkerRunManager * GetWorkerRunManager()
void SetRunID(G4int id)
Definition: G4Run.hh:95
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:466
void SetParallelWorld(G4String parallelWorldName)
static G4ParallelWorldProcessStore * GetInstance()
void ProcessOneEvent(G4Event *anEvent)
#define G4endl
Definition: G4ios.hh:61
virtual void SetUserAction(G4UserRunAction *userAction)
G4bool IsAtRestRequired(G4ParticleDefinition *)
G4Timer * timer
G4bool storeRandomNumberStatus
G4bool geometryInitialized
virtual void TerminateOneEvent()
std::vector< G4String > GetCommandStack()
virtual void DoEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void RunInitialization()
static void UpdateGeometryAndPhysicsVectorFromMaster()
G4VUserPhysicsList * physicsList
void SetNumberOfParallelWorld(G4int i)
G4UserRunAction * userRunAction
virtual void RunTermination()
#define G4ThreadLocal
Definition: tls.hh:69
virtual const T GetSeed(const G4int &sdId)
Definition: G4RNGHelper.hh:58
G4PTblDicIterator * GetIterator() const
G4int GetNumberOfEventsToBeProcessed() const
G4ParallelWorldProcess * GetParallelWorldProcess() const
G4int runIDCounter
void reset(G4bool ifSkipIon=true)
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:73
const CLHEP::HepRandomEngine * getMasterRandomEngine() const
static G4VVisManager * GetConcreteInstance()
void SetProcessOrderingToSecond(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4WorkerThread * workerContext
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
virtual void ThisWorkerEndEventLoop()
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
static G4ScoringManager * GetMasterScoringManager()
void SetRandomNumberStatus(G4String &st)
Definition: G4Run.hh:103
G4int numberOfEventProcessed
virtual void StoreRNGStatus(const G4String &filenamePrefix)
bool G4bool
Definition: G4Types.hh:79
#define G4MUTEX_INITIALIZER
Definition: G4Threading.hh:88
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
void SetRandomNumberStatus(G4String &st)
Definition: G4Event.hh:125
G4int GetNumberOfSelectEvents() const
virtual G4Event * GenerateEvent(G4int i_event)
virtual void TerminateEventLoop()
void CleanUpPreviousEvents()
virtual void SetUserAction(G4UserRunAction *userAction)
static G4ScoringManager * GetScoringManagerIfExist()
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:49
G4int storeRandomNumberStatusToG4Event
G4int GetEventModulo() const
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
virtual void AnalyzeEvent(G4Event *anEvent)
G4int GetRunID() const
Definition: G4Run.hh:76
void MergeRun(const G4Run *localRun)
G4int n_select_msg
virtual G4bool SetUpAnEvent(G4Event *, long &s1, long &s2, long &s3, G4bool reseedRequired=true)
void SetIgnoreCmdNotFound(G4bool val)
Definition: G4UImanager.hh:271
G4int numberOfEventToBeProcessed
G4Run * currentRun
void Stop()
Float_t d
G4UserWorkerInitialization * userWorkerInitialization
static G4bool fGeometryHasBeenDestroyed
virtual void ProcessOneEvent(G4int i_event)
const G4UserWorkerInitialization * GetUserWorkerInitialization() const
virtual void ThisWorkerReady()
void GeometryHasBeenDestroyed()
virtual void ConstructScoringWorlds()
G4bool runAborted
Definition: G4Run.hh:46
G4int GetThreadId() const
G4String randomNumberStatusForThisRun
static G4TransportationManager * GetTransportationManager()
G4LogicalVolume * GetMeshElementLogical() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
void SetNumberOfEventToBeProcessed(G4int n_ev)
Definition: G4Run.hh:97
void SetMeshElementLogical(G4LogicalVolume *val)
virtual void InitializeGeometry()
int G4int
Definition: G4Types.hh:78
static G4int SeedOncePerCommunication()
G4HCtable * GetHCtable() const
Definition: G4SDManager.hh:101
void MergeScores(const G4ScoringManager *localScoringManager)
G4ProcessManager * GetProcessManager() const
void WorkerG4ParticleTable()
virtual void SetUserInitialization(G4VUserPhysicsList *userInit)
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
static G4WorkerRunManagerKernel * GetWorkerRunManagerKernel()
virtual G4Run * GenerateRun()
static G4RunManagerKernel * GetMasterRunManagerKernel()
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4DCtable * DCtable
void WorkerConstruct(G4VPhysicalVolume *fWorldPhys)
G4GLOB_DLL std::ostream G4cout
void WorkerDefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
std::list< G4Event * > * previousEvents
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=0, G4int n_select=-1)
virtual void TerminateWorker()
void UpdateScoring()
G4VScoringMesh * GetMesh(G4int i) const
virtual void GeneratePrimaries(G4Event *anEvent)=0
G4String GetSelectMacro() const
virtual G4int SetUpNEvents(G4Event *, G4SeedsQueue *seedsQueue, G4bool reseedRequired=true)
const G4UserWorkerThreadInitialization * GetUserWorkerThreadInitialization() const
#define TIMEMORY_AUTO_TIMER(str)
Definition: G4TiMemory.hh:66
static G4TemplateRNGHelper< T > * GetInstance()
Definition: G4RNGHelper.cc:37
G4String randomNumberStatusForThisEvent
static G4ScoringManager * GetScoringManager()
virtual void SetMaster(G4bool val=true)
virtual WorkerActionRequest ThisWorkerWaitForNextAction()
G4String randomNumberStatusDir
void SetEventID(G4int i)
Definition: G4Event.hh:115
virtual void InitializeWorker()
void SetParallelWorldProcess(G4ParallelWorldProcess *proc)
virtual void ThisWorkerProcessCommandsStackDone()
G4int verboseLevel
G4int n_perviousEventsToBeStored
G4RunManagerKernel * kernel
virtual void RunTermination()
G4String GetWorldName(G4int i) const
std::mutex G4Mutex
Definition: G4Threading.hh:84
G4int G4GetThreadId()
Definition: G4Threading.cc:128
virtual void MergePartialResults()
G4EventManager * eventManager