Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Toon Moene <toon@moene.indiv.nluug.nl>
Subject: Re: g77 experience (now with comment on NDP f77)
Date: Thu, 24 Apr 97 23:59:35 +0200	[thread overview]
Message-ID: <3aa27453d80d781f0e20405c9cf66adb.axp-list@archive.invalid> (raw)

Harold Youngren wrote:

>  First, the only posted timings I have seen only involve
>  the DEC C and gcc, not f2c/gcc and f77.  The bottom line
>  here is that a native Fortran compiler can optimize far
>  better than a C compiler and you see this in the
>  comparisons of f2c/cc and f77 on any platform with a good
>  native fortran compiler.

First of all, the correct comparison is between g77 and DEC f77 (or  
f90).  Granted, it is not easy to build g77 on an ELF Alpha Linux  
system (due to the fact that the author only has an old ECOFF  
system).

>  I just chose the LINPACK as a standard of comparison
>  (this LINPACK was the undoctored benchmark from standard
>  net sources, like ORNL, with the sizes increased to
>  400/401 to get reliable timing) because everybody could
>  get it.  The difference between DEC f77/f90 and f2c/gcc
>  is really 2x-3x for most any of the "real-life" fortran
>  codes that I have worked with, including big 3D Euler
>  and NS codes.  When you crank up the optimization on the
>  DEC compiler and play with the loop unrolling you get a
>  big speedup.

Note that on my system, for some codes, I get a 2 fold speedup  
between g77 and f2c/gcc.  The difference is mainly the default  
optimisations g77 will perform vs. the default for f2c/gcc (i.e.,  
g77 -O2 != f2c/gcc -O2).

Also note that you don't have "to play with loop unrolling" with  
Digital's Fortran compiler - it will do that from optimisation level  
-O3 onwards, no questions asked (-O4 is the default optimisation,  
i.e. that what you get when you specify no particular optimisation  
on the command line).

g77 (and gcc) require an explicit -funroll-loops to do loop  
unrolling (the rational here is that this will increase code size  
and hence shouldn't be done "automatically").

[ .... KAP discussion elided ..... ]

>>On the other hand if your codes are not of a LINPACK type then
>>people using f2c/gcc do not seem to fare too badly. :-)

>  This is misleading.  You can't just brush off the speed
>  differences between f2c/gcc and DEC f77 to the libraries
>  either as most simple math operations such as these
>  matrix/vector operations don't make library calls for
>  anything in the main loops, this is just simple code
>  optimization and scheduling.  The optimized BLAS would
>  give big speedups for only the calls to the libraries
>  which would be pretty good for codes which are written
>  specifically around the BLAS but would not help the code
>  that doesn't involve the BLAS calls.

Concur with that.

--
Toon Moene (mailto:toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
g77 Support: mailto:fortran@gnu.ai.mit.edu; NWP:  
http://www.knmi.nl/hirlam

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-04-24 21:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-24 21:59 Toon Moene [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-04-24 11:57 g77 experience (now with comment on NDP f77) Harold H.Youngren
1997-04-23 21:33 Harold H.Youngren
1997-04-24  3:33 ` Michal Jaegermann
1997-04-24 17:30   ` Scott Locklin
1997-04-24 18:01     ` CHIH-HSIANG HENRY YAO
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox