13.3.3. Examples for Communication Calls

PreviousUpNext
Up: Communication Calls Next: Accumulate Functions Previous: Get

These examples show the use of the MPI_GET procedure. As all MPI RMA communication procedures are nonblocking, the associated operations must be completed by subsequent calls to synchronization procedures. In the following example, completion is accomplished with the routine MPI_WIN_FENCE, introduced in Section Synchronization Calls.


Example We show how to implement the generic indirect assignment A = B(map), where A, B, and map have the same distribution, and map is a permutation. To simplify, we assume a block distribution with equal size blocks.

Image file


Example A simpler version can be written that does not require that a datatype be built for the target buffer. One then needs a separate get operation for each entry, as illustrated below. This code is much simpler, but usually much less efficient, for large arrays.

Image file


PreviousUpNext
Up: Communication Calls Next: Accumulate Functions Previous: Get


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