Wednesday, 10-Mar-2010 20:01:02 MST

gfortran.org



With all the gfortran options available, how do you pick one that gives
you the best performance ?

Plus, you have a couple of different 'classes' of optimisations.  Most
everyone is familiar with the overall optimisation levels, -01,-02,-O3,
but options also exist for specific chips and instruction sets.

A good all around option, which gives fast code without taking too many
dangerous shortcuts is -O2.   -fast-math is for those that who want the 
fastest possible code; not the most correct code.  -O2 should compile 
in a reasonable amount of time and a source level debugger should be
usable (like gdb).

Another place to optimise, is to compile for the specific chip set you
intend on running the code (which may or may not be the chip set you are
using to compile the code). i386 will work on a wide range of systems, but
for fastest code match the arch with the chip you intend to use for running 
the compiled code.

Here are the architecture options:

  "generic",
  "i386",
  "i486",
  "pentium",
  "pentium-mmx",
  "pentiumpro",
  "pentium2",
  "pentium3",
  "pentium4",
  "pentium-m",
  "prescott",
  "nocona",
  "core2",
  "geode",
  "k6",
  "k6-2",
  "k6-3",
  "athlon",
  "athlon-4",
  "k8",
  "amdfam10"


  gfortran -O2 -g -march=core2  xxx.f -o xxx.f





On this site

Contact

If you have ideas for other content for this website, please feel free to contact 
the webmaster, bdavis9659@sbcglobal.net
Comments and suggestions are always welcome.

This website gets about 400 hits a day, and makes several dollars a year from
advertising. (several, as in < $10 USD)

Google