[mpi-22] Proposal: C++ MPI constructors
Jeff Squyres
jsquyres at [hidden]
Fri Jan 18 14:07:08 CST 2008
Per http://www.cs.uiuc.edu/homes/wgropp/projects/parallel/MPI/mpi-errata/
, the errata item entitled "C++ constructors for MPI objects".
Mail discussing: http://www.cs.uiuc.edu/homes/wgropp/projects/parallel/MPI/mpi-errata/discuss/C++objs/
Proposal:
MPI-2, page 350, before line 37, add
// MPI::Op::Init is deprecated
MPI-2, page 350, after line 37, add
Op Op::Create(User_function* function, bool commute);
--> In MPI-2.2, if the C++ bindings for MPI-1 functions (like
MPI_OP_CREATE) are put in the rest of the document, MPI::Op::Init
should be marked as deprecated.
Rationale:
I'm actually reversing my position from the April 2000 e-mail; the
path of least resistance is to make MPI::Op be the same as all other
MPI classes, even if it is awkward.
Specifically, if we *really* wanted to do it right, the C++ bindings
for various MPI_*_CREATE functions should be overloaded C++
constructors (e.g.,
MPI::Op::Op(User_function* function, bool commute),
MPI::Intracomm::Intracomm(const Group& group), etc.) so that you could
do things like this:
MPI::Op op(user_function, true);
MPI::Intracomm(group);
But I think that's too much for MPI-2.2. Perhaps for MPI-3 (if anyone
cares). Note that such constructors would only be syntactic sugar
since the same functionality can be obtained in the current MPI C++
API, but the current functionality feels slightly "unnatural" to C++.
Note that this is an MPI-2.2 proposal.
--
Jeff Squyres
Cisco Systems
More information about the Mpi-22
mailing list