How to generate Random Numbers in parallel Computation


vivekanand
12-03-2007, 04:56 AM
Hi,
I am working on application where I am applying the concept of parallel computation while carrying out the Monte Carlo simulations.

The problem I am facing is the generation of Random numbers in multiple machines.

Suppose intially I have to carry out 4000 Simulation and I have send these simulations to be carried out in 4 different machine. But I want to assure that the random numbers which all 4 machined would be generating should be different from the result generated on single machine (originally without using parallel compuation method).

The Random number which I am using are basically pseudo Random numbers. So if I give the same seed to all the machines then I get the same numbers and if I give any seed to mahcines then though I would get different random numbers but would they be correlated?

Please help me out in this as this is very important step in my development.

Thanks in advance
Vivek Anand

Bill Press
12-10-2007, 08:33 PM
If the period of the random generator is sufficiently long (say, > 10^35), then you are safe in picking a seed s and then sending s+1, s+2, ... as seeds to your threads number 1, 2, .... You might want to "warm up" the generators by having each thread make 10 calls to its generator.

The generators in NR Second Edition don't have long enough periods for this to be completely safe, but the default generator Ran in NR Third Edition, or the faster generator Ranq2 there should be fine.