[MOAB-dev] SEEK_SET again

Jed Brown jed at 59A2.org
Wed Oct 21 10:45:53 CDT 2009


Jason Kraftcheck wrote:
> Jed Brown wrote:
>> This applies to both MOAB and CGM.  MPI implementations usually overcome
>> the namespace collision by including iostream and redefining the global
>> macros as static const int (which can be used in case statements just
>> like the macros could).  The problem is that the macro smashing that you
>> do in MBProcConfig.hpp and CGMProcConfig.hpp means that the MPI cannot
>> redefine these symbols (since pulling in iostream doesn't actually
>> define them).  This breaks the build.
>>
>> Prior to MPICH2-1.0.8, the correct procedure was to define
>> MPICH_IGNORE_CXX_SEEK (this logic is already in MOAB) and NOT smash the
>> macros in *ProcConfig.hpp.  With MPICH2-1.0.8 and later as well as Open
>> MPI, you should not do anything special (but the build does fail if you
>> smash the macros, at least with Open MPI).  MPI-3 will abolish
>> MPI::SEEK_* entirely.
>>
> 
> And what is the correct procedure for an MPI 2.0 implementation other than
> MPICH?

I'm not familiar with implementations other than MPICH (and derivatives
including MVAPICH, Intel, Microsoft, IBM, Cray, MX) and Open MPI.  These
prefer (or insist on) no macro smashing.  The MPI Forum definitely
regards MPI::SEEK_* to be a mistake and as far as I know, all
implementations either have a way of accomodating (such as the one
described above), or respect a macro to disable these definitions.

Note that macro smashing causes nasty order dependence, see MBCore.cpp
and MBParallelComm.hpp.

IIRC, your concern when I brought this up before was that some user
might expect that behavior when they included the header indirectly.  In
my opinion, it's none of MOAB's business to make these sort of decisions
for the user.  If it is causing a problem for a user, they should
include mpi.h themselves so that they can control it's environment.


Jed

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20091021/53e76cae/attachment-0001.pgp>


More information about the moab-dev mailing list