[lammps-users] making lammps with intel mpi environment

Dear all,

when making lammps on an ALTIX machine using Intel MPI environment I was
confronted to a conflict of "SEEK_*" variables which are also used in
"stdio.h", causing error messages of this type

"/opt/intel/mpi/3.0.043/include64/(45): catastrophic error: #error
directive: SEEK_SET is #defined but must not be for the C++ binding of MPI"

on every .ccp souce file using "stdio.h"

To solve this known problem I modified the "Makefile.altix" to add the
-DMPICH_IGNORE_CXX_SEEK compiling option:

CCFLAGS = -O2 -DMPICH_IGNORE_CXX_SEEK

...and this works fine.

Since I'm not sure this was already pointed out I decided to send this
message.

best
Noel Jakse

Good to know. This compiler flag is already necessary for many other platforms. Probably we need to add it to Makefile.altix too.

Good to know. This compiler flag is already necessary for many other
platforms. Probably we need to add it to Makefile.altix too.

aidan,

this is needed for _every_ MPI implementation that is derived
from MPICH. there is a conflict with some stdio defines and
the c++ bindings of MPICH. since LAMMPS only uses the c bindings
of MPI but uses a c++ compiler the MPICH headers choke on it,
as they implicitly assume that when you compile with a c++
compiler that you also want to use the c++ bindings.

because of only using the c bindings it would be best
to disable including the c++ bindings altogether with

-DMPICH_SKIP_MPICXX

instead. that would allow to compile LAMMPS with flags
that disable including run-time type-information (e.g.
-fno-rtti with gcc/g++) and exception handling (e.g.
-fno-exceptions with gcc/g++) which will result in a
little performance gain.

since this define is MPICH specific, it should be safe
to set this in every makefile.

cheers,
    axel.

BTW: other MPI implementations like OpenMPI don't
suffer from this.

Axel,

Thanks for the extra info. I also use -DMPICH_SKIP_MPICXX on my mac with Open MPI for a different reason. It speeds up compilation time by about 4x, because the compiler no longer has to process all the extra MPI C++ header files in each source file. So I agree that adding -DMPICH_SKIP_MPICXX to all the different Makefiles would be a good idea.

Aidan

Axel,

Thanks for the extra info. I also use -DMPICH_SKIP_MPICXX on my mac
with Open MPI for a different reason. It speeds up compilation time by
about 4x, because the compiler no longer has to process all the extra
MPI C++ header files in each source file. So I agree that adding

now that is strange. are you certain that you are using OpenMPI?
there is no mentioning of MPICH in the OpenMPI headers (at least
not since version 1.2 which is the oldest i have access to).

if performance due to preprocessing of headers is
a concern, you may want to check out the ccache software:
http://ccache.samba.org/

cheers,
    axel.

Sorry, the flag I use with Open MPI is a different one:

-DOMPI_SKIP_MPICXX

I did not notice the first part is OMPI, rather than MPICH. I wonder if is there a general version of this flag that is independent of the specific MPI implementation.

Sorry, the flag I use with Open MPI is a different one:

-DOMPI_SKIP_MPICXX

I did not notice the first part is OMPI, rather than MPICH. I wonder if is
there a general version of this flag that is independent of the specific MPI
implementation.

i don't think so. the real issue is that somehow it
got established that using a c++ compiler implies
using the c++ bindings, when it would have been
much better to have placed the c++ bindings _only_
in their own header, e.g. mpicxx.h, similar to what
was done with mpif.h for fortran 77.

but then again, there are so many other things in the
practical MPI implementations that don't make much
sense either, and that are much harder to work around.

if youd'd put both defines into all makefiles, that should
cover a lot of ground and will have the added benefit that
somebody "accidentally" using the c++ bindings will get
to know of this at compile time.

cheers,
    axel