[MOAB-dev] MPI implementations and SEEK_*
Jed Brown
jed at 59A2.org
Thu Oct 16 07:21:03 CDT 2008
MBProcConfig.hpp has this kludge so that MPICH2 does not complain about
the SEEK_* macros (defined in iostream) conflicting with the MPI symbols
MPI::SEEK_*.
/* MPICH2 will fail if SEEK_* macros are defined
* because they are also C++ enums. Undefine them
* when including mpi.h and then redefine them
* for sanity.
*/
# ifdef SEEK_SET
# define MB_SEEK_SET SEEK_SET
# define MB_SEEK_CUR SEEK_CUR
# define MB_SEEK_END SEEK_END
# undef SEEK_SET
# undef SEEK_CUR
# undef SEEK_END
# endif
#include "mpi.h"
# ifdef MB_SEEK_SET
# define SEEK_SET MB_SEEK_SET
# define SEEK_CUR MB_SEEK_CUR
# define SEEK_END MB_SEEK_END
# undef MB_SEEK_SET
# undef MB_SEEK_CUR
# undef MB_SEEK_END
# endif
As discussed in this FAQ entry
http://www.mcs.anl.gov/research/projects/mpich2/support/index.php?s=faqs#cxxseek
an alternative is to define MPICH_IGNORE_CXX_SEEK which will prevent
MPICH2 from defining the MPI::SEEK_* symbols. Note that MPI_SEEK_* are
always defined.
I mention this because the development version of Open MPI is
complaining about the current hack. I suggest defining
MPICH_IGNORE_CXX_SEEK and removing the hack. Note that this also fixes
the order-dependence alluded to in this comment (in MBCore.cpp)
/* Leave MBParallelComm.hpp before mpi.h or MPICH2 will fail
* because its C++ headers do not like SEEK_* macros.
*/
Jed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <https://lists.mcs.anl.gov/mailman/private/moab-dev/attachments/20081016/6a39fddf/attachment.pgp>
More information about the moab-dev
mailing list