(j3.2006) Rationale for RANDOM_INIT?

Steven G. Kargl kargl
Thu Jan 11 01:42:29 EST 2018


On Thu, Jan 11, 2018 at 11:25:52AM +0900, Malcolm Cohen wrote:
> >From a user's 
> >prespective, she has no way of knowing whether a single
> >seed was used to initialize the PRNG in each image or
> 
> Oh yes they do.
> 

A posteria as user can try to see what the seeds were.  But,
the section of RANDOM_SEED already states that for 

call random_seed(put=oseed)
call random_seed(get=nseed)

oseed does not need to equal nseed.

> 
> >*distinct* seeds were used. That's an implementation detail,
> 
> No, it is part of the API.
> 

I disagree; other than J3 has codified implementation details
into the API.

> 
> RANDOM_SEED(GET=) and (PUT=) have requirements.
> 
> >The only thing that the user cares about is what
> >does RANDOM_NUMBER return after a call to RANDOM_INIT with
> >IMAGE_DISTINCT=.true. (and whether the sequences satisfy the
> >properties of a uniform distribution on [0,1)).
> 
> That is absolutely not the case.  The repeatability requirement
> is a quite common user requirement for RANDOM_NUMBER.  There is
> no reason this should suddenly cease to be available just because
> the user also wants different sequences on different images.
> 

I did not say anything about repeatability.  IMAGE_DISTINCT
is only about distinct seeds, which is implicitly meant to 
mean distinct sequences.

Using xoshift1024* from the paper I cited leads to an implementation
where 2 images can be instantiate with (in psuedo-code)

image0:
   1.) Seed PRNG with XXXX
   2.) Determine image index
   3.) Use image index to jump to non-overlapping subsequence.

image1:
   1.) Seed PRNG with XXXX
   2.) Determine image index (which will be different from image0)
   3.) Use image index to jump to non-overlapping subsequence. 

The seed is not distinct but the sequences are.  This is repeatable.
XXXX always initializes the PRNG to the same element.  The jump 
function then jumps to the *distinct* subsequence.  If you're not
interesting in looking at the paper, xorshift can used to get
2**512 non-overlapping seequence with each sequence having a 
periond of 2**512.  

-- 
Steve



More information about the J3 mailing list