Jan Blechta <[email protected]> writes:
> I think that wrapper was originally created to take care of creating
> duplicate of COMM_WORLD in routines which may not guarantee that
> transfers are entirely finished before return. Programmer could, of
> course, call MPI_Comm_dup but wrapper takes care of freeing MPI_Comm
> when it goes out of scope.
>
> Where appropriate, MPI_COMM_WORLD or PETSC_COMM_WORLD is used directly
> instead of creating duplicate by the wrapper.

You have to MPI_Comm_dup() so that your tags don't conflict with other
users of the communicator.  But you can attach your "inner" communicator
as an attribute on the outer communicator, and also attach your tag
dispenser as an attribute.  Your objects use the inner communicator for
communication, but pass around the outer communicator.  The difference
is that by putting your private information inside, you can always get
it back no matter how many other libraries the communicator has been
passed through.  This is what PETSc does and I think it composes much
better than any wrapper system.

Attachment: pgp_S7voXpPPo.pgp
Description: PGP signature

_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to