----- Original Message -----
From: Anthony Stone <[log in to unmask]>
To: Friedrich Hertweck <[log in to unmask]>
Cc: Van Snyder <[log in to unmask]>;
<[log in to unmask]>
Sent: Thursday, June 01, 2000 2:23 PM
Subject: Re: What do compilers do about assumed-shape dummy arguments?
>
> At 11:45 on 1 June, Friedrich Hertweck wrote:
>
> > Below is a program that does a very simple thing: add the values of
> > an array and return it. There are four versions of subroutines to
> > do this:
> > [etc.]
>
> Here are results for Sun's WorkShop 6 beta:
>
> f77 loop, contiguous array, sum =32761.333984 time = 12.625000
> f77 loop, stride 2x2 array, sum =32761.333984 time = 13.437500
> f90 loop, contiguous array, sum =32761.333984 time = 18.906250
> f90 loop, stride 2x2 array, sum =32761.333984 time = 19.656250
> f90 SUM(stride 2x2 array), sum =32761.248047 time = 1.531250
>
> A striking time difference in the last case -- but a significant
> difference in the sum. Repeating the calculation in double precision
> gives the following:
>
> f77 loop, contiguous array, sum =32761.333984 time = 16.750000
> f77 loop, stride 2x2 array, sum =32761.333984 time = 17.218750
> f90 loop, contiguous array, sum =32761.333984 time = 23.656250
> f90 loop, stride 2x2 array, sum =32761.333984 time = 24.218750
> f90 SUM(stride 2x2 array), sum =32761.248047 time = 3.656250
>
> So it isn't a rounding error problem, and the program isn't using
> different values each time it is run, it would seem.
>
> --
> Anthony Stone http://fandango.ch.cam.ac.uk/
> University Chemical Laboratory, Email: [log in to unmask]
> Lensfield Road, Phone: +44 1223 336375
> Cambridge CB2 1EW Fax: +44 1223 336362
>
|