RE: [AMBER-Developers] questions about compiler flags

From: Ross Walker <>
Date: Tue, 2 Feb 2010 07:28:51 -0800

Hi Mengjuei,

My 2c here from lots of testing. If you are on an x86_64 machine you need to
use one of the vectorization options to get good performance or the SSE
units will not get used. For example -xP etc. I am not sure if the configure
script still adds these by default for the Intel compilers. It should since
they can make a 25%+ difference in speed. Note selecting the optimum option
for your chip version and compiler version can also have a big difference
but the number of combinations is huge. -ip can help a bit by doing
interprocedural optimization within a source file but since we tend to
split things into lots of different source files the effect of this is
minimial. -ipo is much better as this does it across all the files. The
Intel compilers (and some others as well) offer a -fast option which is what
I added for PMEMD.

This option is useful since it selects the 'best' optimization flags for
your architecture including selecting which -x option to use. It is also
compiler version independent, just specify -fast and you are done for ALL
versions of the compiler. This works great for PMEMD but I have not turned
it on for sander because of one major problem. Specifying -fast turns on
-ipo and there appears to be no way to stop this. What this does is largely
defer all optimization until link time. This serializes the most compute
intensive part of the compilation, negating things like -j8 which is a real
pain. The other problem is that it uses lots of memory and can take a long
time to link. PMEMD is sufficiently small enough that this is not a problem
but for sander I was often swapping at link stage and then you ended up in
the several hours to link regime. Hence why it is not on in the sander
config.h file.

We could try reintroducing -fast and see how it does. Maybe with all the
libraries we build now it will not be so tough at link stage. Alternatively
I think optimization should be "-O3 -ip -axWPS" although this format changes
depending on compiler version.

All the best

> -----Original Message-----
> From: [mailto:amber-developers-
>] On Behalf Of Mengjuei Hsieh
> Sent: Tuesday, February 02, 2010 1:40 AM
> To: AMBER Developers Mailing List
> Subject: Re: [AMBER-Developers] questions about compiler flags
> On Mon, Feb 01, 2010 at 03:18:40PM -0500, case wrote:
> > Two compiler options questions:
> [libc issues deleted]
> > 2. Do we really need the "-ip -O3 -xHost" flags for optimized ifort
> compiles?
> > Is this better/worse/the same as "-fast" (used for pmemd)? Does
> sander need
> > anything more than -O3? Is there a good compromise between "fastest
> of all
> > 2^N possible combinations of flags on this particular machine" and
> "something
> > that sacrifices a few percent in performance but which is likely to
> both work
> > now and continue working after Intel puts out its next release"?
> IIRC, "-ip" doesn't really optimized the speed too much although it
> does theoretically reduce program loading time. As to -xHost, isn't
> it for replacing SSE1/2/3 ? I like SSE* arguments, but I am not sure
> if that gives you dramatic performance boost.
> If performance is really a concern for certain programs, how about
> we release some well-optimized executables for them on some major
> platforms?
> Best,
> --
> Mengjuei
> _______________________________________________
> AMBER-Developers mailing list

AMBER-Developers mailing list
Received on Tue Feb 02 2010 - 07:30:03 PST
Custom Search