Skip to content

MPI_Comm_idup*: allow copying of new comm handle before completion #577

Open
@jprotze

Description

Problem

The standard states:

It is erroneous to use the communicator newcomm as an input argument to other MPI functions before the MPI_COMM_IDUP operation completes.

But there is no text that clarifies, whether the MPI_Comm variable referenced by newcomm can be copied (e.g., passed by value to a function call) before completion. As request is mentioned in the reference to nonblocking collective semantics, but newcomm is not, the delayed modification of the handle value seems not be covered.

In general, it would be possible that an implementation stores the address and fills the variable during operation completion, making a copy of the MPI_Comm variable invalid.

Proposal

Add text to clarify whether the content of the newcomm variable can be safely copied after return of MPI_COMM_IDUP(_WITH_INFO) or add a restriction.

Changes to the Text

TBD

Impact on Implementations

OpenMPI and MPICH set the handle before return of the function. They also copy attributes of the old communicator to the new communicator before returning, as required by the standard. With the requirement to copy attributes before return, it does not really make sense to delay setting the newcomm variable until the operation completes.

Impact on Users

Be certain to write correct code :)

Impact on Tools

Be able to track communicator creation inside the non-blocking call without the need to keep track of the request and collecting the handle information on operation completion.

References and Pull Requests

Metadata

Labels

chap-contextsGroups, Contexts, Communicators, Caching Chapter Committeempi-6For inclusion in the MPI 5.1 or 6.0 standard

Type

No type

Projects

  • Status

    To Do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions