[MOAB-dev] [PATCH] Call MPI_Init if using MPI.

Jed Brown jed at 59A2.org
Wed Oct 28 16:29:39 CDT 2009


Tim Tautges wrote:
> IMO, this should be internal to MOAB proper, not in the tools.  That
> way, serial applications outside of MOAB aren't responsible for
> MPI_Init'ing.

That patch was just duct-tape.  You can have an MBInit()/MBFinalize()
pair but of course you need to accomodate the case where the user
retains control over initializing MPI.

I am strongly in favor of using dummy MPI implementations for serial
builds.  Almost all MPI functions can be implemented as macros when the
communicator is guaranteed to have size 1.  This gets rid of all the
messy preprocessor stuff.  If some code must be run in serial, you just
check the size of your communicator and error if it is larger than 1.

$PETSC_DIR/include/mpiuni/mpi.h may be suitable as a drop-in replacement.


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/20091028/652febc0/attachment.pgp>


More information about the moab-dev mailing list