[PATCH, fortran/52879] RANDOM_SEED revisited

N.M. Maclaren nmm1@cam.ac.uk
Sun Feb 9 22:10:00 GMT 2014


On Feb 9 2014, Steve Kargl wrote:
>> 
>> Unless it has been changed since 4.5.1, they are not independent;
>> they are merely separate.  Using 3 copies of them probably does not
>> make any significant difference - if you want to get a benefit from
>> combining generators, then you must use ones based on very distinct
>> mathematical properties, or where they have known independence.
>
>I suppose it's a matter of semantics as in a short email I am not
>going to worry about the inconsequential details.  But, yes,
>random_number uses 3 different sequences drawn from Marsaglia's KISS
>generator.  One might even say those 3 different sequences are
>independent, but this is totally irrelevant to the patch at hand.

Yes, it's quite irrelevant, which is I pruned the list.  But, while
they would commonly be called independent, that is seriously incorrect.
There are circumstances where it matters, even with the way that they
are used.

>The 3 different sequences are not being combined to generate some
>new 32-bit entity.  The first sequence gives bits 0-31, the second
>sequence gives bits 32-63, and the third sequence gives bits 64-112.

I missed that - my apologies.

>See my reply to Dominique where I have code that shows why one
>may want the above mapping.

Oh, yes, I wouldn't deny the usefulness of that.

Harking back to the original problem, the root cause is in the
misdesign of the Fortran specification, not anything that gfortran
has done.  Saving and restoring the state is semantically entirely
different from setting a seed; if they had been properly separated,
this issue would not have arisen.


Regards,
Nick Maclaren.



More information about the Fortran mailing list