This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Gfortran vs Ifort when using MPI
IainS wrote:
On 8 Jul 2008, at 21:25, FX wrote:
Depending on the system, using the right -march makes a big
difference. Try -march=native (not supported on all targets). (If the
compiler thinks that there is no SSE, -march=native can help a lot;
if I recall correctly, for x86 the settings are rather conservative.
For a 50x-100x performance difference, I suppose there is something
*awfully* wrong going on, like wrong alignment or NaNs all over the
place. I suggest a) checking the results, b) roughly profiling the
gfortran code ("gfortran -pg" and using gprof) to get an idea where it
spends so much time. It'll be much easier than us shooting in the dark.
One thing you might check for in your profiling is presence of, and
different handling of, denormals - that can make huge difference on x86.
Iain
For 32-bit, any of the options -march=pentium4 or newer is sufficient to
enable -ftree-vectorize. All march options support it for 64-bit.
gfortran defaults to abrupt underflow only when -ffast-math is set.
You could set abrupt underflow explicitly in a C function, before reaching
the trouble spot, e.g. by the underflow control of IEEE_arithmetic, if
present, if necessary implementing your own IEEE_SET_UNDERFLOW_MODE in a C
function using the <xmmintrin.h> FTZ facility.