37 #include "DetectorConstruction.hh"
38 #include "PhysicsList.hh"
39 #include "ActionInitialization.hh"
41 #ifdef G4MULTITHREADED
52 #include "CommandLineParser.hh"
65 using namespace G4DNAPARSER;
72 void Parse(
int& argc,
char** argv);
76 int main(
int argc,
char** argv)
85 #ifdef G4MULTITHREADED
103 G4cout <<
"**************************************************************"
104 <<
"******\n===== Chem4 is started with "
107 <<
" available threads =====\n\n*************************************"
108 <<
"*******************************"
168 G4String command =
"/control/execute ";
226 noice = labs((
long)
noise());
228 const char * env = std::getenv(
"PBS_JOBID");
233 G4String jobID_string = buffer.substr(0, buffer.find(
"."));
234 jobID_string.erase(std::remove_if(jobID_string.begin(),
238 jobID_int = atoi(jobID_string.c_str());
242 env = std::getenv(
"SGE_TASK_ID");
243 if(env) jobID_int = atoi(env);
248 seed = ((long)
time(NULL)) + jobID_int + noice;
253 G4Random::setTheSeed(
seed);
263 #if defined(WIN32)|| defined(_WIN32)|| defined(__WIN32)&&!defined(__CYGWIN__)
267 unsigned int random_seed, random_seed_a, random_seed_b;
268 std::ifstream
file (
"/dev/urandom", std::ios::binary);
272 int size =
sizeof(
int);
273 memblock =
new char [size];
274 file.read (memblock, size);
276 random_seed_a = *
reinterpret_cast<int*
>(memblock);
284 random_seed = random_seed_a xor random_seed_b;
291 void Parse(
int& argc,
char** argv)
299 "Select geant4 UI or just launch a geant4 terminal"
308 "Give a seed value in argument to be tested",
"seed");
310 #ifdef G4MULTITHREADED
312 "Launch in MT mode (events computed in parallel,"
313 " NOT RECOMMANDED WITH CHEMISTRY)",
"2");
317 "Deactivate chemistry");
320 "Select a visualization driver",
"OGL 600x600-0+0");
323 "Deactivate visualization when using GUI");
326 "Launch the code on a cluster, avoid dupplicated seeds");