Ralf W. Grosse-Kunstleve wrote:
Without knowing the compiler options, the results of any benchmark
are meaningless.
I used
   gfortran -o dsyev_test_gfortran -O3 -ffast-math dsyev_test.f

If you work on a 32bit x86 system, you really should use -march=native and possibly -mfpmath=sse - otherwise you might generate code which also works with very old versions of x86 processors. (On x86-64 -march=native is also useful albeit the effect is not as large; ifort's equivalent option is -xHost. By default, ifort uses SSE and more modern processors on 32bit.)

A possibly negligible effect is that ifort ignores parentheses by default - to be standard conform, use ifort's -assume protect_parens. (Or gfortran's -fno-protect-parens, though your gfortran might be too old.)

An interesting test could be to use Intel's libimf with gfortran-compiled binaries by setting the
  LD_PRELOAD=/opt/intel/Compiler/.../lib/.../libimf.so
environmental variable (complete the path!) before running the binary of your program. Another check could be to compile with the -mveclibabi=svml and link then Intel's short vactor math library. That way you make sure you compare the compiler itself and not the compiler + libraries.

In terms of options, I think -funroll-loops should also be used as it usually improves performance (it is not enabled by any -O... option).

GCC 4.5/4.6: You could also try "-flto -fwhole-file". (Best to use 4.6 for LTO/-fwhole-file.)

Tobias

Reply via email to