After building an application based on examples and testing on Cluster of computers using Redhat Linux Enterprise 6, G4MPI is not using different random number seeds from MPI on beamOn for each node. For both exMPI01 and exMPI02, when using the command /run/printProgress ... the exact same random number appears for both ranks every time. When running exMPI02, slightly different results occur just because of the randomized medical beam, not because of different number seeds. In my application using GPS beam source, GEANT4 is using the exact same random number for all nodes even thou /mpi/showSeeds gives different random number seeds for each rank, and the results from each rank are exactly the same. I have tried setting seeds manually with the exact same results for all nodes.
Thank you for reporting this. In the latest releases of 10.0 through 10.0-p02, we identified a bug in manually setting random number seeds in multithreaded application. Your issue seems to be caused by this same bug. We will verify it and update you.
Hello Matthew, thank you for reporting this. I am sorry about this problem. However I need some more information before proposing a fix. In particular: 1- which version of Geant4 are you using exactly? 2- have you compiled Geant4 in multi-threading mode or sequential mode (it can be seen from the Geant4 banner of G4 when you start an application. It should read (version number/date is different, but please note the "<< in Multi-threaded mode >>" line ************************************************************* Geant4 version Name: geant4-10-00-ref-07 [MT] (31-July-2014) << in Multi-threaded mode >> Copyright : Geant4 Collaboration Reference : NIM A 506 (2003), 250-303 WWW : http://cern.ch/geant4 ************************************************************* 3- Finally do you use a UI command to set the random-seed? Or, more in general, how do you set the random seed? Thank you for your help and your patience, Andrea
Possible solution being tested in tag. Note this pug affects only 10.1.beta and not 10.0 series
Sorry my previous comment is wrong: bug is also present in 10.0 series. Thus the fix will go into a possible 10.0 patch
MPI Libraries set the seed in G4MPImanager.cc. There are two errors in the current file Line 290 reads CLHEP::HepRandom::setTheSeed(seed_list[rank_]); should be G4Random::setTheSeed(seed_list[rank_]); Line 301 read << " seed= " << CLHEP::HepRandom::getTheSeed() should be << " seed= " << G4Random::getTheSeed() I'm applying the fix listed in 1657 G4RunMessenger.cc to see if it fixes the setting random number.
Solved in MPI-V10-00-02. Will be included in revised MPI in 10.1