Fortran compiler strangeness

Thomas Koenig tkoenig@alice-dsl.net
Wed May 9 15:54:00 GMT 2007


On Wed, 2007-05-09 at 17:12 +0200, Stefano Simonucci wrote:

> time ./a.out 
> 
> real    1m58.509s
> user    1m57.035s
> sys     0m0.792s
> 
> An analogous program in C takes 22 sec.
> Then I have changed sin(1.+i+j) with sin(1.d0+i+j) 
> and I get the following execution time
> 
> 
> real    0m23.868s
> user    0m22.737s
> sys     0m0.864s

Steve Kargl already remarked on the type conversions, which may
be a cause for this.

I tried to reproduce your example on an Athlon XP, but the
execution times were almost identical, so this appears to
be platform-specific.  What is the output, on your system,
of "gfortran -v" ?

What happens if you consistently change everything to double
precision, or everything to default real?

	Thomas
   



More information about the Fortran mailing list