(j3.2006) Rationale for RANDOM_INIT?

Steven G. Kargl kargl
Wed Jan 3 18:51:05 EST 2018


On Wed, Jan 03, 2018 at 06:37:30PM -0500, Steve Lionel wrote:
> On 1/3/2018 6:16 PM, Steven G. Kargl wrote:
> > I'm trying to understand the rationale behind the
> > new RANDOM_INIT subroutine, and in particular why
> > is the second argument, IMAGE_DISTINCT, not an
> > optional argument?  It seems that its purpose is
> > to be used in a program that uses co-arrays where
> > multiple instances of the program will be executed.
> > This then suggests that the argument is of no use
> > with programs that will never use co-arrays.
> >
> > Is there a Nxxx.pdf document that I sould read?
> >
> The paper you want is J3 14-184r4 
> (http://j3-fortran.org/doc/year/14/14-184r4.txt) . N2013 
> (https://wg5-fortran.org/N2001-N2050/N2013.txt) is also relevant. Even 
> though I wrote the spec, I don't recall exactly why IMAGE_DISTINCT 
> wasn't optional. I think there was sentiment that there was no obvious 
> choice for a default behavior and there are only two arguments (at this 
> time.) This intrinsic arose from a UK country comment. We noted at the 
> time that implementations differed in how they interpreted a call to 
> RANDOM_SEED with no arguments (left unspecified by the standard), and 
> that there was a need to also allow specification of how the RNG 
> operated across images.
> 

Thanks for the pointer to the papers.  I understand the
need for RANDOM_INIT as I wrote gfortran's RANDOM_SEED
years ago.  I made the decision that 'CALL RANDOM_SEED()'
would re-initialize the prng with the same set of seeds.
That decision was not popular with some users who expected
the call to initialize the prng to a new stream 

-- 
Steve



More information about the J3 mailing list