(j3.2006) (SC22WG5.4114) Parallel random numbers

Aleksandar Donev adonev
Thu Oct 22 12:01:56 EDT 2009


On 10/22/2009 4:52 AM, N.M. Maclaren wrote:

> Specifying what is defined and what is not is very hard when
> you need to allow for two different models. 
Perhaps then we should pick one of the models, namely, the independent 
sequence one.

>> If we do the choice is obvious: separate generators on each image. 
> Oh, no, it isn't!  It's HAIRY designing decent quasi-independent
> generators, and most of the methods aren't scalable.
I never dreamt of the compiler group providing me with quasi-independent 
sequences. We don't even require RANDOM_NUMBER to return anything close 
to reasonable. Any serious application that actually needs to rely on 
independence among images will need to use its own generator (which may 
of course be provided by the compiler vendor as an additional intrinsic 
or some such).

Putting in restrictions on where one can call RANDOM_SEED breaks the 
simple parallelism model in which each image runs independently and 
things happen only if explicitly specified. It also seems useless since 
there are no guarantees nor any way for the user to control anything. 
How does the user get quasi-independent numbers on different images in 
the model you specified? Should only image 1 call RANDOM_SEED and that 
is expected to do it. Should he call RANDOM_SEED with different numbers 
on each image, the generation of which is specified in some compiler 
manual? Or should he call with the same seed on each image?

What I believe we ought to do is provide the simplest model and not try 
to do much:
1) All the sequencies are independent
2) The same random number generator is used on each image (same seed, 
same sequence).
3) No restrictions on calling RANDOM_SEED and RANDOM_NUMBER ala ordering 
of segments.
If the user wants to get different sequencies on different images, just 
use different seeds. No quasi-independence or any such quality 
guarantees---this is to be used in simple tests, debugging, student 
codes, and for certain algorithms where the quality does not matter much 
(for example, random alternation algorithms in linear-algebra algorithms 
or even some PDE grid solvers)

Best,
Aleks

-- 
Aleksandar Donev, Ph.D.
Luis W. Alvarez Postdoctoral Fellow
Center for Computational Sciences and Engineering (https://ccse.lbl.gov)
Lawrence Berkeley National Laboratory (http://www.lbl.gov)
E-mail: adonev at lbl.gov
Phone: (510) 486-5782  Fax: (510) 486-6900
Address: MS 50A-1148, LBL, 1 Cyclotron Rd., Berkeley, CA 94720
Web: http://cims.nyu.edu/~donev/



More information about the J3 mailing list