Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Fortran Programming Language

compiler flags for gfortran on Intel Xeon 64-bit wkstation


I am trying to port my old code to my new Intel Quad Core Xeon
workstation with two "clovertown" processors. I have a 64-bit Linux OS
installed (Ubuntu 7.04) and I'm trying to use gfortran 4.1.2.

Several questions:

1) I'm trying to install LAPACK 3.1.1. I have downloaded the
precompiled ATLAS 3.6.0 library "Linux_HAMMER64SSE2_2", and was going
to link against it. What compiler flags should I use?

2) I am trying to run a code written in standard f90. It does Monte
Carlo simulation so optimum speed is critical. What compiler flags
should I use? Note my code also uses fftw which I downloaded and
installed.

In my old "32-bit" machine the flags I used where: -O3 -
march=pentium4. What should I use for the "64-bit" machine? Just
reading the gcc manual it seams the it should be -O3 -m64, is there
any -march or -mtune parameters that I should consider? The Xeon
Clovertown processor can apparently use MMX,SSE,SSE2,SSE3,SSSE3 and
EM64T instructions, should I use -march=nocona?

Any help would be appreciated

Manuel

That's what I use when compiling stuff with gcc.

Hi,

On May 24, 5:47 pm, mjm2@columbia.edu wrote:

> Several questions:
> In my old "32-bit" machine the flags I used where: -O3 -
> march=pentium4. What should I use for the "64-bit" machine? Just
> reading the gcc manual it seams the it should be -O3 -m64, is there

It should already default to -m64 on x86-64 machines.

> any -march or -mtune parameters that I should consider?

Depending what Ubuntu did, using -march=native could work.
(I think it was added in GCC 4.2, but several distributions had it
already earlier.)
This enables the right -march* for that processor.

> The Xeon > Clovertown processor can apparently use MMX,SSE,SSE2,SSE3,SSSE3 and
> EM64T instructions, should I use -march=nocona?

Yes. Note that this does not imply SSSE3. -mssse3 exists, but only in
the GCC 4.3 developer versions. (Unless your distribution did backport
this - mine did for 4.1.x.)

I personally like to use -ftree-vectorize, which should speed up
calculations.

I think GCC 4.2 is faster (especially gfortran) than 4.1. Ubuntu might
provide some optional 4.2 packages. (openSUSE does so in Factory and
via the build service for older distributions; at http://gcc.gnu.org/wiki/GFortranBinaries
are also 4.2 and 4.3 binaries available.)

Tobias

> It does Monte Carlo simulation so optimum speed is critical.

It's funny how different can be the points of view of people doing
essentialy the same kind of thing. I also work with Monte Carlo
simulations, and I would have said something more like: "It does Monte
Carlo simulation so calculation precision is critical".

> What compiler flags should I use? Note my code also uses fftw which I
> downloaded and installed.

Have you studied how your overall performance is dependent of BLAS/LAPACK
and FFTW speed? Working on speed optimization before you actually profile
the code is always a bet.

About the details of the optimization flags, other people have answered.
In the end, if speed is really that valuable to you, you might want to
look at optimization flags selection tools like Acovea
(http://www.coyotegulch.com/products/acovea/ ; I have no interest in that
product myself, but find the idea pleasant).

--
FX

"Tobias Burnus" <bur@net-b.de> wrote in message

news:1180024631.724192.174360@q69g2000hsb.googlegroups.com...

> It should already default to -m64 on x86-64 machines.

Not in osx, and -m64 isn't even available in xp-x64.

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc