seed for random number generator with parallel computation

Eric Wajnberg wajnberg at sophia.inra.fr
Thu Apr 23 04:10:34 EDT 2009


Dear all,

For years I am developing my codes to run Monte Carlo simulations. For 
this I am using the random number generator ran2 from L'Ecuyer 
(numerical recipes) without any problem. Actually, in order to have a 
continuous flow of random values, each run of my codes stores at the end 
a seed value in a file that is then read on next run to initiate the 
random number generator, etc.

The point is that the running time for the problem I have to solve now 
is far too long and I thus decided to implement my codes on a cluster. 
The computation time obviously drastically reduced but I am now facing a 
new problem that I cannot solve. The point is that several runs of my 
codes are now launched simultaneously, and are thus using the same seed, 
which is then wrong.

Can someone tell me what is the usual policy used in this case to start 
the random number generator with random seeds, that are different from 
one run to the other? Are you simply using the pid of the process each 
time to initiate the random number generator?

Any hint on this will be welcomed.

Thanks in advance for that.

Cheers, Eric.



More information about the comp-simulation mailing list