From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Thu Jan 17 17:09:56 2013
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id A2188356A27; Thu, 17 Jan 2013 17:09:31 +0100 (CET)
Delivered-To: sc22wg5@open-std.org
Received: from exprod6og114.obsmtp.com (exprod6og114.obsmtp.com [64.18.1.33])
	by www.open-std.org (Postfix) with ESMTP id 9535B356957
	for <sc22wg5@open-std.org>; Thu, 17 Jan 2013 17:09:12 +0100 (CET)
Received: from CFWEX01.americas.cray.com ([136.162.34.11]) (using TLSv1) by exprod6ob114.postini.com ([64.18.5.12]) with SMTP
	ID DSNKUPgGXwnPscAt8A9EhGe9Modmd8V9g3NA@postini.com; Thu, 17 Jan 2013 06:10:51 PST
Received: from fortran.us.cray.com (172.31.19.200) by
 CFWEX01.americas.cray.com (172.30.88.25) with Microsoft SMTP Server id
 14.2.318.1; Thu, 17 Jan 2013 08:06:39 -0600
Message-ID: <50F80574.4020402@cray.com>
Date: Thu, 17 Jan 2013 08:06:44 -0600
From: Bill Long <longb@cray.com>
Reply-To: <longb@cray.com>
Organization: Cray Inc.
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version: 1.0
To: sc22wg5 <sc22wg5@open-std.org>
Subject: Re: (j3.2006) (SC22WG5.4904) [ukfortran] Comment on a comment on
 the WG5 letterballot on N1947
References: <20130108205438.50F4E356B56@www.open-std.org><20130113210632.B1C67356BEA@www.open-std.org><20130116050422.92E30356BE0@www.open-std.org><20130116191114.A6A75356A2B@www.open-std.org><20130116223411.D135F356A2B@www.open-std.org> <20130116231527.45C11356C30@www.open-std.org> <20130117025541.22E48356C9E@www.open-std.org>
In-Reply-To: <20130117025541.22E48356C9E@www.open-std.org>
Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-sc22wg5@open-std.org
Precedence: bulk



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@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


