Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

Stunned! Gfortran 4.5 produces faster code on new Imac than Intel 11.1

Greynolds__Alan
Beginner
334 Views
Just got my new Imac with a 3.33Ghz Core 2 Duo processor. So far all tests of my application show that the Gfortran 4.5 compiled version is ~25% faster than the Intel 11.1.067 compiled version. Has anyone else seen this surprising result?
With Intel I used the -fast option while for Gfortran I used the following:

-O3 -funroll-loops -march=native -ffast-math -mfpmath=sse -msse4.1 -ftree-vectorizer-verbose=1

The results of the calculations appear to be the same within expected FP accuracy and roundoff.

Al Greynolds


0 Kudos
1 Reply
TimP
Honored Contributor III
334 Views
On individual benchmarks with Fortran 95 syntax, loop length 100 and greater, on Core i7, I see gfortran 4.5 varying from 15% to 300% of the speed of ifort 11.1. Sticking to f77 code, ifort consistently out-performs gfortran on the same benchmarks.
gfortran performs extremely aggressive unrolling with the options you quote. On Core i7, it has to be limited to unrolling by 4 to show full performance, although the extra unrolling should gain on your Core Duo when your loop lengths match the unrolling.
In general, you would require ifort standard compliance options -assume protect_parens,minus0 -prec-div -prec-sqrt to see satisfactory accuracy comparisons with gfortran.
gfortran -ffast-math does introduce some optimizations which are equivalent to ifort defaults.
It doesn't make much sense to quote a comparison with no context. It's certainly possible that you have applications which hit the weaknesses of ifort, but not those of gfortran. If you can make a case for their importance, you have the choices of showing them here or filing issues on premier.intel.com. Specifically, where gfortran vectorizes successfully and ifort doesn't, a simple test case would be useful.
0 Kudos
Reply