[mpi-21] Ballot 4 proposal: MPI::COMM_WORLD and MPI::COMM_SELF should be const
Jeff Squyres
jsquyres at [hidden]
Mon Jan 21 09:40:39 CST 2008
This is not already on Bill's errata page.
Proposal: Make MPI::COMM_WORLD and MPI::COMM_SELF be "const".
Change MPI-2:B.2 p345:18 from
// Type: MPI::Intracomm
to
// Type: const MPI::Intracomm
Rationale: The COMM_WORLD and COMM_SELF C++ handles were erroneously
not marked "const" because of the incorrect INOUT MPI handle parameter
designation of the MPI_COMM_SET_ERRHANDLER, MPI_COMM_SET_ATTR, and
MPI_COMM_SET_ERRHANDLER functions. This caused the C++ bindings
methods to not be const, resulting in compile errors if COMM_WORLD was
const and you invoked any of the methods listed above (e.g.,
MPI::COMM_WORLD.Set_errhandler(...)).
The proper solution is to have all the MPI handle arguments be IN
instead of INOUT (covered in another proposal) and therefore have the
Set_* functions be const (also covered that other proposal). Once
that solution is in place, COMM_WORLD and COMM_SELF should be marked
as "const". Not that many other predefined MPI C++ handles are
already const; some erroneously had their "const" designation removed
in ballot 2 -- a different proposal seeks to restore their "const"
status.
NOTE: This proposal depends on the "change some INOUT parameters to
IN" proposal.
--
Jeff Squyres
Cisco Systems
More information about the Mpi-21
mailing list