On Sun, 19 Jul 2020, Sven Schreiber wrote:
here's a question about some details of random number generation in
I have read the relevant section 7 of the gretl + MPI guide, but one
thing still isn't clear to me: How to imitate the effect of what "set
seed" would do in the standard single-thread setting? As far as I
understand, the default setting in gretl's MPI world is to have separate
RNGs, to preserve independence of the pseudo-random numbers. OK. The
alternative that is described in the guide is to enforce identical RNG
sequences in all parallel threads.
What about the case where you want to have independent RNG sequences
across processes, but you want to be able to control them for
replication purposes, from one run to the next? How to achieve that
effect in gretl's MPI implementation?
print "starting MPI..."
set seed 88775531
matrix m = mnormal(3,3)
if $mpirank == 0
end mpi --np=3
Run it a few times and you'll always get the same results, though
the three 3 x 3 matrices differ from each other.