Message: G4RNGHelper::GetSeed() causing crash Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question G4RNGHelper::GetSeed() causing crash 

Forum: Multithreading
Date: 26 Aug, 2015
From: <mattia>

Hello,

I am running a multi-threaded Geant4 application for medical purposes. Whenever I run it for testing (only few events), there are no issues and the program terminates correctly.
Now that I would like to have some statistically significant results, I run longer simulations (>1e9 events), which take several hours to complete.
Then, my application has never terminated correctly and I always get this exception message:

G4WT15 >
-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : Run0035
      issued by : G4RNGHelper::GetSeed
No seed number 7294(7294 available)
 Original seed number -2 filled so far 2147480000
*** Fatal Exception *** core dump ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

G4WT15 >
G4WT15 > *** G4Exception: Aborting execution ***
Aborted

real 165m34.505s
user 661m19.348s
sys 0m10.101s

The problem appears equally on our computing cluster running Debian7 and Geant4.10.01.p01, as well as on my laptop computer running Ubuntu 14.04 and the same Geant4 version.
Furthermore, I have never encountered this problem when running short jobs (1-2 hours), but when launching jobs for 4 hours or more this issue always appears.

So far I have tried to understand from the original source code (see http://www.apc.univ-paris7.fr/~franco/g4doxy4.10/html/_g4_r_n_g_helper_8hh_source.html) what is going wrong, but I admit that I have not fully understood why this problem appears.

For each run I set the random number seed using an environment variable:

  char* runID = getenv("ID");
  if(runID != NULL){
    long seed1 = atoi(G4String(runID));
    long seed2 = (seed1 * 45 + 345236) * seed1;
    if(seed2 < 0)
      seed2 = -seed2;
    long seeds[2];
    seeds[0] = seed1;
    seeds[1] = seed2;
    G4cout << "The random number seeds are " << seeds[0] << " and " << seeds[1] << G4endl;
    G4Random::setTheSeeds(seeds);

I am using a Ranecu engine.

Has anybody else ever experienced this problem? Or even a solution? I have not found any useful reference concerning this so far...
Every suggestion will be appreciated.

Thanks a lot in advance!

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Idea: Re: G4RNGHelper::GetSeed() causing crash   (Andrea Dotti - 26 Aug, 2015)
1 Question: Re: G4RNGHelper::GetSeed() causing crash   (Lukas Jungk - 09 Feb, 2016)
(_ Warning: Re: G4RNGHelper::GetSeed() causing crash   (Andrea Dotti - 09 Feb, 2016)
2 Agree: Re: G4RNGHelper::GetSeed() causing crash   (mattia - 14 Sep, 2015)
 Add Message Add Message
to: "G4RNGHelper::GetSeed() causing crash"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews