(j3.2006) (SC22WG5.4907) [ukfortran] Comment on a comment on the WG5 letterballot on N1947

Bill Long longb
Thu Jan 17 09:06:44 EST 2013



On 1/16/13 6:57 PM, Malcolm Cohen wrote:

>> Of course, there are numerous cases, almost all related to user-written random
>> number generators, where overflow of integer multiply is intentional.
>
> (0) Random number generators have also been available on machines with hardware
> always-on integer overflow detection.
>

Yes, I remember this from the VAX era.

> (1) This is almost certainly entirely unnecessary.  Many good generators don't
> need this.
>

I said the practice was "intentional", not necessary.  Indeed, such 
generators tend to be of poorer quality, though they are very fast.

> (2) It is not exactly beyond the wit of man to avoid using a compiler option
> when it is undesired!

VAX users quickly learned that.  But irrelevant to the point that the 
integer overflow was intentional, and not an error that needed to be 
exposed.

>
>> For Fortran, and a program with arrays this large, users would instinctively
>> set a compiler switch to make 64-bit integers the default.
>
> Ah yes, the "non-Fortran" switch (unless it also doubles the sizes of default
> real and double precision).
>

Indeed. I much prefer a "default64" switch that does both integer and 
real, as opposed to the independent-r8 / -i8 style switches.   It would 
be even better for the programmer to not use default integer or real 
declarations, but include specific KIND parameters.  Unfortunately it is 
hard to change old habits.  As an example, the brand new MPI 3 Fortran 
interface still uses default INTEGER declarations.

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





More information about the J3 mailing list