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

Robert W. Numrich rwn
Fri Oct 23 17:20:07 EDT 2009

I agree with Aleks:

quote --------------

"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)

unquote ---------------

Making things "proceesor dependent", as suggested below, is a bad idea.
If the programmer wants some special random sequence, he needs to generate
it himself.  If he is serious about random numbers, even on a single
processor, he should generate his own and not depend on some compiler
generated sequence with no known properties.

How could a shared sequence ever allow a programmer to bebug his code or
generate reproducible results?  The member of the sequence obtained by any
particular image at run-time would be random, OK unless you are trying to
debug, but very expensive because it probably implies some sort of lock/unlock
of the sequence located somewhere, perhaps on image one.

Making this processor dependent makes it difficult (impossible?) to write
portable code.  It also breaks the fundamnetal SPMD model that coarrays
are based on.  Do we have any other intrinsic procedures, other than sync's,
that imply some global effect across images?

> >    It is processor dependent whether RANDOM_SEED and RANDOM_NUMBER use
> >    a common generator for all images or whether each image uses a
> >    separate one.
> The word "common" might be misinterpreted as "same algorithm" or even
> "ordinary". Maybe "shared" would be better.
> This seems sufficiently vague to be backward compatible with F03 and any
> current implementation.
> We typically discuss in normative text results of execution, rather than
> the method of computing the results. Maybe the whole bit should be a
> NOTE in the RANDOM_NUMBER subclause. Or maybe word this as
>  "It is processor dependent whether the sequence of values returned by
> RANDOM_NUMBER is separate for each image, or is taken from a shared
> sequence.  If separate, then calls to RANDOM_SEED affect only the
> sequence on the same image."


			-bob numrich

Robert W. Numrich, PhD
Senior Research Associate
Minnesota Supercomputing Institute
587 Walter Library
117 Pleasant Street SE
Minneapolis, MN 55455

Tel:  612-624-4341

More information about the J3 mailing list