This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNU FORTRAN implementation v4.3.2


On 02/22/2010 10:20 AM, Fuentes, Adolfo wrote:
> I'm trying to compile the file <nbody.f90> from <http://shootout.alioth.debian.org/> [The Computer Language Benchmarks Game]
I could not find the source code there; I have now used:
  http://people.brunel.ac.uk/~eesridr/nbody.f90
  http://go.googlecode.com/hg/test/bench/nbody.c
I do not know whether they a match the latest code at s.a.d.o.

> The problem I've got is that when I compile the file with GNU FORTRAN 95 4.3.2-1-1 and G95 FORTRAN 0.91, and the options shown below, the difference in computing time between the binaries created by both compilers is huge.

No real idea - here the differences are relatively small. Tested on AMD
Athlon(tm) 64 X2 Dual Core Processor 4800+ with GCC (gcc, gfortran) 4.5
of today and with ifort 11.1.046.

ifort is 5% faster than gfortran and gfortran is about 6% faster than
gcc; those differences are too small to draw a real conclusion -
especially not about Fortran vs. C.

$ gcc -march=native -O3 -ffast-math -flto -fwhole-program nbody.c -lm
$ time ./a.out 50000000
-0.169075164
-0.169059907

real    0m22.357s
user    0m21.885s
sys     0m0.000s

$ gfortran -march=native -O3 -ffast-math -flto -fwhole-program
-fno-protect-parens nbody.f90
$ time ./a.out 50000000
-0.169075164
-0.169059907

real    0m21.005s
user    0m20.217s
sys     0m0.004s

$ ifort -fast -O3 nbody.f90
$ time ./a.out 50000000
-0.169075164
-0.169059907

real    0m19.912s
user    0m19.237s
sys     0m0.012s

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]