From: David Duffy on
I've just been playing with the latest iteration of the Open64 Fortran
compiler (version 4.2.3). This has more and more Fortran 95, and some
Fortran 2003, features. The most annoying lack, for me, was
access='stream'. For a regression suite for my stats package (which
covers a range of activities), I obtained (linux, i7 920 2.67 GHz)

compiler real user sys
openf95 -fast 6.573 6.548 0.024
6.612 6.592 0.020
6.664 6.552 0.016
gfortran -O2 7.634 7.612 0.028
7.689 7.652 0.040
7.752 7.732 0.024
sunf95 -O3 -autopar 10.874 10.845 0.028
10.917 10.893 0.024
10.963 10.869 0.020
g95 -O2 11.946 11.885 0.060
12.044 11.977 0.068
12.056 11.997 0.056

These are all 32 bit, even the Open64 ;). As usual, I probably could
fiddle a bit with optimal flags for each compiler, but interesting. It
would be nice to see the Polyhedron benchmarks for Open64.

Cheers, David Duffy,

PS The program and regression suite are at
http://www.qimr.edu.au/davidD#Sib-pair, but I haven't uploaded
the latest version that compiles with openf95 yet.

--
| David Duffy (MBBS PhD) ,-_|\
| email: davidD(a)qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / *
| Epidemiology Unit, Queensland Institute of Medical Research \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v
From: FX on
> openf95 -fast
> gfortran -O2

The very very important difference here is whether you allow "fast math"
routines, i.e. a trade-off of more speed for less accurate math
operations. -fast does enable this, as far as I remember, but -O2 in
gfortran (and g95) doesn't. As a consequence, your comparison probably
doesn't mean as much as you would like.

Try "-O2 -ffast-math" at least on gfortran/g95.

--
FX
From: Tobias Burnus on
David Duffy wrote:
> openf95 -fast
> gfortran -O2

Additionally, "openf95 -fast" might optimize for a specific architecture
while by default GCC generates code for rather old CPUs. Try,
"-march=native" (or find yourself the suitable -march=* option). On
x86-64 this is not so much of a problem as all of them have at least
SSE2 thus the generic setting and the specific setting does not differ
as much as with 32bit. I don't know the current settings, but you might
generate code which is compatible with i386 ;-)

You could also try -O3 (as you did for sunf95); it usually does not make
much of a difference, but sometimes it does.

> PS The program and regression suite are at
> http://www.qimr.edu.au/davidD#Sib-pair, but I haven't uploaded
> the latest version that compiles with openf95 yet.

The URL does not work for me ("Page Not Found").

Tobias

PS: For production code, I would be careful with GCC's -ffast-math and
also -O3. Both allow "unsafe" optimizations, for instance, assuming that
all numbers are finite (i.e. no NaN, no infinity). The same is true for
other compilers, though they might have different option names. By the
way, some compilers ignore by default the parentheses in expressions
like "(A+B)+C" - gfortran only does so if you use "-fno-protect-parens".
From: David Duffy on
FX ecrit:

> The very very important difference here is whether you allow "fast math"
> routines, i.e. a trade-off of more speed for less accurate math
> operations. -fast does enable this, as far as I remember, but -O2 in
> gfortran (and g95) doesn't. As a consequence, your comparison probably
> doesn't mean as much as you would like.
> Try "-O2 -ffast-math" at least on gfortran/g95.

And Tobias Burnus <burnus(a)net-b.de> wrote:

> Additionally, "openf95 -fast" might optimize for a specific architecture
> while by default GCC generates code for rather old CPUs. Try,
> "-march=native" (or find yourself the suitable -march=* option).
>> PS The program and regression suite are at
>> http://www.qimr.edu.au/davidD#Sib-pair, but I haven't uploaded
>> the latest version that compiles with openf95 yet.
> The URL does not work for me ("Page Not Found").

Our website was upgraded yesterday ;( I am now at

http://www2.qimr.edu.au/davidD#Sib-pair

> PS: For production code, I would be careful with GCC's -ffast-math and
> also -O3. Both allow "unsafe" optimizations, for instance, assuming that
> all numbers are finite (i.e. no NaN, no infinity).

Yes. One deficiency of the Open 64 compilers is there is little current
documentation. However, this is the GCC based front end (AFAICT from the
code, GCC 4.2), so I tried

/opt/open64/bin/openf95 -Ofast -fno-fast-math -DOPEN64 -DNOESCAPE
-DVERSION="'1.00.beta Open64 (29-Jul-2010) '" -o
/home/davidD/bin/sib-pair.open64 open64-sp.F95

openf95 WARNING: -Ofast conflicts with -fno-fast-math; using latter value
(-fno-fast-math)

For statistical computing purposes, I avoid -fast-math.

For gfortran (gcc version 4.5.0 20091118), I then tried "-O3
-march=native". This still gives gfortran 6.6 s v 7.5 s. Anyway, the
point of my original email, FWIW, is that there is a usable third or is
it fourth GPL'ed Fortran 95 compiler.

Cheers, David Duffy.

--
| David Duffy (MBBS PhD) ,-_|\
| email: davidD(a)qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / *
| Epidemiology Unit, Queensland Institute of Medical Research \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v
From: baf on
David Duffy wrote:
> FX ecrit:
>
>> The very very important difference here is whether you allow "fast math"
>> routines, i.e. a trade-off of more speed for less accurate math
>> operations. -fast does enable this, as far as I remember, but -O2 in
>> gfortran (and g95) doesn't. As a consequence, your comparison probably
>> doesn't mean as much as you would like.
>> Try "-O2 -ffast-math" at least on gfortran/g95.
>
> And Tobias Burnus <burnus(a)net-b.de> wrote:
>
>> Additionally, "openf95 -fast" might optimize for a specific architecture
>> while by default GCC generates code for rather old CPUs. Try,
>> "-march=native" (or find yourself the suitable -march=* option).
>>> PS The program and regression suite are at
>>> http://www.qimr.edu.au/davidD#Sib-pair, but I haven't uploaded
>>> the latest version that compiles with openf95 yet.
>> The URL does not work for me ("Page Not Found").
>
> Our website was upgraded yesterday ;( I am now at
>
> http://www2.qimr.edu.au/davidD#Sib-pair
>
>> PS: For production code, I would be careful with GCC's -ffast-math and
>> also -O3. Both allow "unsafe" optimizations, for instance, assuming that
>> all numbers are finite (i.e. no NaN, no infinity).
>
> Yes. One deficiency of the Open 64 compilers is there is little current
> documentation. However, this is the GCC based front end (AFAICT from the
> code, GCC 4.2), so I tried
>
> /opt/open64/bin/openf95 -Ofast -fno-fast-math -DOPEN64 -DNOESCAPE
> -DVERSION="'1.00.beta Open64 (29-Jul-2010) '" -o
> /home/davidD/bin/sib-pair.open64 open64-sp.F95
>
> openf95 WARNING: -Ofast conflicts with -fno-fast-math; using latter value
> (-fno-fast-math)
>
> For statistical computing purposes, I avoid -fast-math.
>
> For gfortran (gcc version 4.5.0 20091118), I then tried "-O3
> -march=native". This still gives gfortran 6.6 s v 7.5 s. Anyway, the
> point of my original email, FWIW, is that there is a usable third or is
> it fourth GPL'ed Fortran 95 compiler.
>
> Cheers, David Duffy.
>

It is nice having alternatives, but imagine how great the situation
would be if all of that energy was thrown behind one compiler based on
current versions of gcc instead of three.