60 "If G4 kernel is not initialized, it will be initialized.");
61 beamOnCmd->
SetGuidance(
"Default number of events to be processed is 1.");
62 beamOnCmd->
SetGuidance(
"The second and third arguments can be used for");
63 beamOnCmd->
SetGuidance(
"executing a macro file at the end of each event.");
64 beamOnCmd->
SetGuidance(
"If the second argument, i.e. name of the macro");
65 beamOnCmd->
SetGuidance(
"file, is given but the third argument is not,");
66 beamOnCmd->
SetGuidance(
"the macro file will be executed for all of the");
68 beamOnCmd->
SetGuidance(
"If the third argument (nSelect) is given, the");
69 beamOnCmd->
SetGuidance(
"macro file will be executed only for the first");
87 verboseCmd->
SetGuidance(
"Set the Verbose level of G4RunManager.");
89 verboseCmd->
SetGuidance(
" 1 : Display main topics");
90 verboseCmd->
SetGuidance(
" 2 : Display main topics and run summary");
93 verboseCmd->
SetRange(
"level >=0 && level <=2");
97 "Display begin_of_event information at given frequency.");
99 "If it is set to zero, only the begin_of_run is shown.");
100 printProgCmd->
SetGuidance(
"If it is set to -1, no print-out is shown.");
106 nThreadsCmd->
SetGuidance(
"Set the number of threads to be used.");
107 nThreadsCmd->
SetGuidance(
"This command works only in PreInit state.");
109 "This command is valid only for multi-threaded mode.");
111 "The command is ignored if it is issued in sequential mode.");
114 nThreadsCmd->
SetRange(
"nThreads >0");
121 "Set the number of threads to be the number of available logical cores.");
122 maxThreadsCmd->
SetGuidance(
"This command works only in PreInit state.");
124 "This command is valid only for multi-threaded mode.");
126 "The command is ignored if it is issued in sequential mode.");
132 "Locks each thread to a specific logical core. Workers "
133 "are locked in round robin to logical cores.");
135 "This command is valid only for multi-threaded mode.");
136 pinAffinityCmd->
SetGuidance(
"This command works only in PreInit state.");
138 "This command is ignored if it is issued in sequential mode.");
140 "If a value n>0 is provided it starts setting affinity "
141 "from the n-th CPU (note: counting from 1).");
142 pinAffinityCmd->
SetGuidance(
"E.g. /run/pinAffinity 3 locks first thread on "
143 "third logical CPU (number 2).");
145 "If a value n<0 is provided never locks on n-th CPU.");
149 pinAffinityCmd->
SetRange(
"pinAffinity > 0 || pinAffinity < 0");
152 evModCmd =
new G4UIcommand(
"/run/eventModulo",
this);
154 "Set the event modulo for dispatching events to worker threads");
156 "i.e. each worker thread is ordered to simulate N events and then");
157 evModCmd->
SetGuidance(
"comes back to G4MTRunManager for next set.");
159 "If it is set to zero (default value), N is roughly given by this.");
161 " N = int( sqrt( number_of_events / number_of_threads ) )");
163 "The value N may affect on the computing performance in particular");
165 "if N is too small compared to the total number of events.");
167 "The second parameter seedOnce specifies how frequently each worker");
169 "thread is seeded by the random number sequence centrally managed");
170 evModCmd->
SetGuidance(
"by the master G4MTRunManager.");
172 " - If seedOnce is set to 0 (default), seeds that are centrally managed");
174 " by G4MTRunManager are set for every event of every worker thread.");
176 " This option guarantees event reproducibility regardless of number");
179 " - If seedOnce is set to 1, seeds are set only once for the first");
181 " event of each run of each worker thread. Event reproducibility is");
183 " guaranteed only if the same number of worker threads are used.");
185 " On the other hand, this option offers better computing performance");
187 " in particular for applications with relatively small primary");
188 evModCmd->
SetGuidance(
" particle energy and large number of events.");
190 " - If seedOnce is set to 2, seeds are set only for the first event of");
192 " group of N events. This option is reserved for the future use when");
194 " Geant4 allows number of threads to be dynamically changed during an");
196 evModCmd->
SetGuidance(
"This command is valid only for multi-threaded mode.");
198 "This command is ignored if it is issued in sequential mode.");
211 dumpRegCmd->
SetGuidance(
"Dump region information.");
213 "In case name of a region is not given, all regions will be displayed.");
219 dumpCoupleCmd->
SetGuidance(
"Dump material-cuts-couple information.");
221 "Note that material-cuts-couple information is updated");
222 dumpCoupleCmd->
SetGuidance(
"after BeamOn has started.");
226 optCmd->
SetGuidance(
"Set the optimization flag for geometry.");
227 optCmd->
SetGuidance(
"If it is set to TRUE, G4GeometryManager will optimize");
229 optCmd->
SetGuidance(
"GEANT4 is initialized with this flag as TRUE.");
235 brkBoECmd->
SetGuidance(
"Set a break point at the beginning of every event.");
240 brkEoECmd->
SetGuidance(
"Set a break point at the end of every event.");
245 abortCmd->
SetGuidance(
"Abort current run processing.");
247 "If softAbort is false (default), currently processing event "
248 "will be immediately aborted,");
249 abortCmd->
SetGuidance(
"while softAbort is true, abortion occurs after "
250 "processing the current event.");
256 abortEventCmd->
SetGuidance(
"Abort currently processing event.");
260 geomCmd->
SetGuidance(
"Force geometry to be closed (re-voxellized) again.");
262 "This command must be applied if geometry has been modified");
263 geomCmd->
SetGuidance(
" after the first initialization (or BeamOn).");
267 geomRebCmd->
SetGuidance(
"Force geometry to be rebuilt once again.");
269 "This command must be applied if the user needs his/her");
270 geomRebCmd->
SetGuidance(
" detector construction to be reinvoked.");
272 "/run/geometryModified is automatically issued with this command.");
278 physCmd->
SetGuidance(
"Force all physics tables recalculated again.");
279 physCmd->
SetGuidance(
"This command must be applied");
280 physCmd->
SetGuidance(
" if physics process has been modified after the");
281 physCmd->
SetGuidance(
" first initialization (or BeamOn).");
286 constScoreCmd->
SetGuidance(
"Construct scoring parallel world(s) if defined.");
287 constScoreCmd->
SetGuidance(
"This command is not mandatory, but automatically "
288 "called when a run starts.");
290 "But the user may use this to visualize the scoring "
291 "world(s) before a run to start.");
297 randomDirectory->
SetGuidance(
"Random number status control commands.");
301 "Initialize the random number generator with integer seed stream.");
302 seedCmd->
SetGuidance(
"Number of integers should be more than 1.");
304 "Actual number of integers to be used depends on the individual "
305 "random number engine.");
306#ifdef G4MULTITHREADED
307 seedCmd->
SetGuidance(
"This command sets the seeds for the master thread.");
316 "Define the directory name of the rndm status files.");
317 randDirCmd->
SetGuidance(
"Directory will be created if it does not exist.");
324 savingFlagCmd->
SetGuidance(
"The randomNumberStatus will be saved at :");
325 savingFlagCmd->
SetGuidance(
"beginning of run (currentRun.rndm) and "
326 "beginning of event (currentEvent.rndm) ");
331 saveThisRunCmd->
SetGuidance(
"copy currentRun.rndm to runXXX.rndm");
336 saveThisEventCmd->
SetGuidance(
"copy currentEvent.rndm to runXXXevtYYY.rndm");
341 "Reset the status of the rndm engine from a file.");
342 restoreRandCmd->
SetGuidance(
"See CLHEP manual for detail.");
343 restoreRandCmd->
SetGuidance(
"The engine status must be stored beforehand.");
344 restoreRandCmd->
SetGuidance(
"Directory of the status file should be set by"
345 " /random/setDirectoryName.");
355 "Reset the status of the rndm engine from a file at each event.");
357 "Note that the file must follow the following naming convention:");
358 restoreRandCmdMT->
SetGuidance(
"run{#1}evt{#2}.rndm ; where #1 is the run "
359 "number and #2 is the event number.");
361 "For example to re-seed the first event of the first "
362 "run the file should be called run0evt0.rndm.");
364 "If for a specific run/event the file is not found, "
365 "the standard re-seeding strategy is used.");
366 restoreRandCmdMT->
SetGuidance(
"This command has meaning only in MT mode for "
367 "strong reproducibility studies.");
368 restoreRandCmdMT->
SetGuidance(
"Directory of the status file should be set by"
369 " /random/setDirectoryName.");
376 "Save random number status at beginning of each event.");
378 "File name contains run and event numbers: runXXXevtYYY.rndm");
383 randEvtCmd->
SetGuidance(
"Flag to store rndm status to G4Event object.");
384 randEvtCmd->
SetGuidance(
" flag = 0 : not store (default)");
386 " flag = 1 : status before primary particle generation is stored");
388 " flag = 2 : status before event processing (after primary "
389 "particle generation) is stored");
390 randEvtCmd->
SetGuidance(
" flag = 3 : both are stored");
392 "Note: Some performance overhead may be seen by storing rndm "
393 "status, in particular");
395 "for the case of simplest geometry and small number of tracks per event.");
398 randEvtCmd->
SetRange(
"flag>=0 && flag<=3");
404 "Force workers to process current stack of UI commands.");
405 procUICmds->
SetGuidance(
"This commands is meaningful only in MT mode.");
412 delete materialScanner;
417 delete maxThreadsCmd;
418 delete pinAffinityCmd;
422 delete dumpCoupleCmd;
426 delete abortEventCmd;
432 delete constScoreCmd;
436 delete savingFlagCmd;
437 delete saveThisRunCmd;
438 delete saveThisEventCmd;
439 delete restoreRandCmd;
440 delete randomDirectory;
441 delete saveEachEventCmd;
446 delete restoreRandCmdMT;
451 if(command == beamOnCmd)
455 const char* nv = (
const char*) newValue;
456 std::istringstream is(nv);
457 is >> nev >> macroFileName >> nst;
458 if(macroFileName ==
"***NULL***")
464 runManager->
BeamOn(nev, macroFileName, nst);
467 else if(command == verboseCmd)
471 else if(command == printProgCmd)
475 else if(command == nThreadsCmd)
485 G4cout <<
"*** /run/numberOfThreads command is issued in sequential mode."
486 <<
"\nCommand is ignored." <<
G4endl;
491 "/run/numberOfThreads command is issued to local thread.");
494 else if(command == maxThreadsCmd)
504 G4cout <<
"*** /run/useMaximumLogicalCores command is issued in "
506 <<
"\nCommand is ignored." <<
G4endl;
512 "/run/useMaximumLogicalCores command is issued to local thread.");
515 else if(command == pinAffinityCmd)
525 G4cout <<
"*** /run/pinAffinity command is issued in sequential mode."
526 <<
"\nCommand is ignored." <<
G4endl;
531 "/run/pinAffinity command is issued to local thread.");
534 else if(command == evModCmd)
541 const char* nv = (
const char*) newValue;
542 std::istringstream is(nv);
543 is >> nevMod >> sOnce;
549 G4cout <<
"*** /run/eventModulo command is issued in sequential mode."
550 <<
"\nCommand is ignored." <<
G4endl;
555 "/run/eventModulo command is issued to local thread.");
558 else if(command == dumpRegCmd)
560 if(newValue ==
"**ALL**")
569 else if(command == dumpCoupleCmd)
573 else if(command == optCmd)
577 else if(command == brkBoECmd)
582 else if(command == brkEoECmd)
587 else if(command == abortCmd)
591 else if(command == abortEventCmd)
595 else if(command == initCmd)
599 else if(command == geomCmd)
603 else if(command == geomRebCmd)
608 else if(command == physCmd)
612 else if(command == seedCmd)
618 while(!(vl = next()).isNull())
620 seeds[idx] =
StoL(vl);
625 G4cerr <<
"/random/setSeeds should have at least two integers. Command "
632 G4Random::setTheSeeds(seeds);
635 else if(command == randDirCmd)
639 else if(command == savingFlagCmd)
643 else if(command == saveThisRunCmd)
647 else if(command == saveThisEventCmd)
651 else if(command == restoreRandCmd)
655 else if(command == randEvtCmd)
660 else if(command == saveEachEventCmd)
665 else if(command == constScoreCmd)
669 else if(command == restoreRandCmdMT)
674 else if(command == procUICmds)
687 "/run/workersProcessCmds command issued on a "
688 "non-G4MTRunManager class instance.");
694 <<
"*** /run/workersProcessCmds command is issued in sequential mode."
695 <<
"\nCommand is ignored." <<
G4endl;
700 "/run/workersProcessCmds command is issued to local thread.");
709 if(command == verboseCmd)
713 else if(command == printProgCmd)
717 else if(command == randDirCmd)
721 else if(command == randEvtCmd)
726 else if(command == nThreadsCmd)
739 else if(command == evModCmd)
752 G4cout <<
"*** /run/eventModulo command is valid only in MT mode."
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static G4int SeedOncePerCommunication()
static void SetSeedOncePerCommunication(G4int val)
virtual void RequestWorkersProcessCommandsStack()
static G4ProductionCutsTable * GetProductionCutsTable()
virtual void AbortRun(G4bool softAbort=false)
virtual void Initialize()
virtual void RestoreRandomNumberStatus(const G4String &fileN)
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
void SetRandomNumberStoreDir(const G4String &dir)
virtual void rndmSaveThisEvent()
virtual void RestoreRndmEachEvent(G4bool)
virtual void AbortEvent()
virtual void rndmSaveThisRun()
RMType GetRunManagerType() const
void PhysicsHasBeenModified()
void SetVerboseLevel(G4int vl)
const G4String & GetRandomNumberStoreDir() const
void SetRandomNumberStorePerEvent(G4bool flag)
void GeometryHasBeenModified(G4bool prop=true)
void SetGeometryToBeOptimized(G4bool vl)
void StoreRandomNumberStatusToG4Event(G4int vl)
G4int GetFlagRandomNumberStatusToG4Event() const
void SetRandomNumberStore(G4bool flag)
void DumpRegion(const G4String &rname) const
G4int GetVerboseLevel() const
virtual void ConstructScoringWorlds()
void SetPrintProgress(G4int i)
G4RunMessenger(G4RunManager *runMgr)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValues)
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetToBeBroadcasted(G4bool val)
static G4String ConvertToString(G4bool boolVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)
void SetPauseAtBeginOfEvent(G4bool vl)
static G4UImanager * GetUIpointer()
void SetPauseAtEndOfEvent(G4bool vl)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
G4int G4GetNumberOfCores()