(j3.2006) RANDOM_INIT question

Cohen Malcolm malcolm
Thu Sep 17 20:22:55 EDT 2015


No.

The description (I'm not going to copy it) says that RANDOM_INIT sets the 
seed.  That is all it does!  Saying "the concept of seed [has no] meaning" 
w.r.t. RANDOM_INIT flies directly in the face of the specification in the 
standard.

Calling RANDOM_INIT once and then RANDOM_SEED (PUT=) is not any different in 
action from calling RANDOM_SEED (PUT=) once, and RANDOM_SEED (PUT=) a second 
time.

More to the point, you can call RANDOM_INIT (REPEATABLE=.FALSE.) once, then 
RANDOM_SEED(GET=), and thus save away the seed that RANDOM_INIT set for 
later use!

There is no contradiction or any kind of conflict in the descriptions as far 
as I can see...

As for RDRAND, it does not return a pseudo-random number sequence so is 
completely unsuitable for implementing RANDOM_NUMBER(*), especially when 
many values are required in a short space of time.  However, it is Very 
Suitable for providing entropy to go into the seed value.  (Though one might 
wish to use other entropy sources as well.)

(*) Completely unsuitable in that it literally cannot provide the actual 
semantics of the RANDOM_* family as specified in Fortran standard.

Cheers,

-----Original Message----- 
From: Bill Long
Sent: Thursday, September 17, 2015 10:44 PM
To: fortran standards email list for J3
Subject: (j3.2006) RANDOM_INIT question


Suppose the program calls RANDON_INIT with the REPEATABLE argument having 
the value false.   In this case, does the concept of a ?seed? have any 
meaning?  Would a call to RANDOM_SEED have any effect for a non-repeatable 
generator?  More particularly, would it be conforming to use the RDRAND 
instruction on recent Intel chips to create the random number returned by 
RANDOM_NUMBER,  and just ignore the seed value set by RANDOM_SEED?

Cheers,
Bill

Bill Long 
longb at cray.com
Fortran Technical Support  &                                  voice: 
651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101


_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org
http://mailman.j3-fortran.org/mailman/listinfo/j3

________________________________________________________________________
This e-mail has been scanned for all viruses by Star.
________________________________________________________________________

-- 
........................Malcolm Cohen, Nihon NAG, Tokyo. 




More information about the J3 mailing list