38 #include "DetectorConstruction.hh"
39 #include "PhysicsList.hh"
40 #include "ActionInitialization.hh"
42 #ifdef G4MULTITHREADED
53 #include "CommandLineParser.hh"
66 using namespace G4DNAPARSER;
73 void Parse(
int& argc,
char** argv);
77 int main(
int argc,
char** argv)
86 #ifdef G4MULTITHREADED
104 G4cout <<
"**************************************************************"
105 <<
"******\n===== Chem5 is started with "
108 <<
" available threads =====\n\n*************************************"
109 <<
"*******************************"
172 G4String command =
"/control/execute ";
218 seed = atoi(commandLine->GetOption().c_str());
230 noice = labs((
long)
noise());
232 const char * env = std::getenv(
"PBS_JOBID");
238 jobID_string.erase(std::remove_if(jobID_string.begin(),
242 jobID_int = atoi(jobID_string.c_str());
246 env = std::getenv(
"SGE_TASK_ID");
247 if(env) jobID_int = atoi(env);
252 seed = ((long)
time(NULL)) + jobID_int + noice;
257 G4Random::setTheSeed(
seed);
267 #if defined(WIN32)|| defined(_WIN32)|| defined(__WIN32)&&!defined(__CYGWIN__)
271 unsigned int random_seed, random_seed_a, random_seed_b;
272 std::ifstream
file (
"/dev/urandom", std::ios::binary);
276 int size =
sizeof(
int);
277 memblock =
new char [size];
278 file.read (memblock, size);
280 random_seed_a = *
reinterpret_cast<int*
>(memblock);
288 random_seed = random_seed_a xor random_seed_b;
295 void Parse(
int& argc,
char** argv)
303 "Select geant4 UI or just launch a geant4 terminal"
312 "Give a seed value in argument to be tested",
"seed");
314 #ifdef G4MULTITHREADED
316 "Launch in MT mode (events computed in parallel,"
317 " NOT RECOMMANDED WITH CHEMISTRY)",
"2");
321 "Deactivate chemistry");
324 "Select a visualization driver",
"OGL 600x600-0+0");
327 "Deactivate visualization when using GUI");
330 "Launch the code on a cluster, avoid dupplicated seeds");