Random number generators discussion

Random number generators | www.agner.org

 
thread Naive implementation of parallel MT - Manuel Miranda - 2008-04-24
last reply Naive implementation of parallel MT - Agner - 2008-04-24
 
Naive implementation of parallel MT
Author:  Date: 2008-04-24 14:23
Hi there,

I have a question on a naive implementation of a parallel MT that I've done using the fortran version of MT19937ar posted in Prof. Matsumoto's website. (http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/FORTRAN/mt19937ar.f)

First, I setup an MT in the master node and seed it with a single integer using subroutine init_genrand(seed). I then use the first 624 outputs from the master node to seed the MT in the first worker node using subroutine init_by_array(array_of_seeds,624). I continue in the same manner for all subsequent worker nodes, taking the next 624 outputs from the master node and using them to seed the MT in all worker nodes. Once this is done, I have a different MT ready for use in all the worker nodes. Do you think this is a good approach? I know that the each block of 624 seeds used to set up the worker node MTs have some correlation (since they are adjacent blocks produced by the same MT), but given the equidistribution properties and the gigantic period of the algorithm, wouldn't these correlations be insignificant for all practical purposes? Would it be better if I used a different RNG algorithm for the master node? If that is so, which one would you recommend?

I know I can't expect perfectly uncorrelated streams of outputs in each node as in serious parallel PRNGs (i.e. SPRNG), but I'm only going to use the code for small workstations/clusters of 8-16 nodes (using mpi).

Any advice would be sincerely appreciated. Keep up the good work!

Manuel

   
Naive implementation of parallel MT
Author: Agner Date: 2008-04-24 17:06
No, you should use a different RNG for seeding your nodes. Preferably completely different.