[MOAB-dev] MPI implementations and SEEK_*
Jason Kraftcheck
kraftche at cae.wisc.edu
Thu Oct 16 09:51:30 CDT 2008
MOAB already defines MPICH_IGNORE_CXX_SEEK for internal use (line 121 of
configure.in .). Presumably this stuff in MBProcConfig.hpp is for the
benefit of applications including that header (indirectly from MBParallelComm.)
- jason
Jed Brown wrote:
> 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
--
"A foolish consistency is the hobgoblin of little minds" - Ralph Waldo Emerson
More information about the moab-dev
mailing list