Does using several random number generators give the truly (pseudo)random sequence? Monte Carlo simulation for implantation.

41 Views Asked by At

Here is the problem. I simulate implantation (shooting ions into the material) with Monte Carlo (MC). The (somewhat simplified) procedure is as following:

  1. Ion (with given initial energy & direction) enters the surface of the material at the random spot.
  2. It moves through material randomly bouncing from atoms and gradually losing energy until it stops.
  3. Several millions of such ions are simulated to obtain the distribution of ions concentration within the material.

'Randomly bouncing' means that at every moment of its journey ion can hit the atom with certain probability (and the way how it hits, e.g. whether this is a direct hit, or a glancing blow, is also non-deterministic).

At the moment, to generate random events the single Mersenne Twister random number generator (RND) is initialized at the beginning and then used throughout the simulation producing the 'continuous sequence' of pseudorandom numbers. If we initialize RND with the same number the results are stochastic in nature, but are repeatable from simulation to simulation, as long as the simulation is done sequentially (on a single core).

However, for parallel computation, when each thread picks its own ion and follows it to the end, the results are not repeatable when single RND is used. It happens, because each thread request random numbers from RND at arbitrary times, depending on processor loading and other factors, so each ion will follow the different path from simulation to simulation.

There are two ideas

  • Each thread gets its own Mersenne Twister RND, initialized with the pseudorandom number.
  • Each ion gets its own Mersenne Twister RND, initialized with the pseudorandom number.

The second idea is more attractive, as in this case, when using the same seed to create the pseudorandom sequence for ion-specific RNDs initialization I will get repeatable identical simulation results between simulations on, say, 1 thread and 8 threads.

The question is, whether the pseudorandom numbers generated in this way will be truly random or not?