7.2.1. Specifics for Intra-Communicator Collective Operations

PreviousUpNext
Up: Communicator Argument Next: Applying Collective Operations to Inter-Communicators Previous: Communicator Argument

All MPI processes in the group identified by the intra-communicator must call the collective routine.

In many cases, collective communication can occur ``in place'' for intra-communicators, with the output buffer being identical to the input buffer. This is specified by providing a special argument value, MPI_IN_PLACE, instead of the send buffer or the receive buffer argument, depending on the operation performed.


Rationale.

The ``in place'' operations are provided to reduce unnecessary memory motion by both the MPI implementation and by the user. Note that while the simple check of testing whether the send and receive buffers have the same address will work for some cases (e.g., MPI_ALLREDUCE), they are inadequate in others (e.g., MPI_GATHER, with root not equal to zero). Further, Fortran explicitly prohibits aliasing of arguments; the approach of using a special value to denote ``in place'' operation eliminates that difficulty. ( End of rationale.)

Advice to users.

By allowing the ``in place'' option, the receive buffer in many of the collective calls becomes a send-and-receive buffer. For this reason, a Fortran binding that includes INTENT must mark these as INOUT, not OUT.

Note that MPI_IN_PLACE is a special kind of value; it has the same restrictions on its use that MPI_BOTTOM has (not usable in Fortran for initialization or assignment). See Section Named Constants. ( End of advice to users.)


PreviousUpNext
Up: Communicator Argument Next: Applying Collective Operations to Inter-Communicators Previous: Communicator Argument


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023