9.9. An Application Example

PreviousUpNext
Up: Virtual Topologies for MPI Processes Next: MPI Environmental Management Previous: Persistent Neighborhood Alltoall


Example Neighborhood collective communication in a Cartesian virtual topology.

The example in Figures An Application Example--An Application Example shows how the grid definition and inquiry functions can be used in an application program. A partial differential equation, for instance the Poisson equation, is to be solved on a rectangular domain. First, the MPI processes organize themselves in a two-dimensional structure. Each MPI process then inquires about the ranks of its neighbors in the four directions (up, down, right, left). The numerical problem is solved by an iterative method, the details of which are hidden in the subroutine relax.

In each relaxation step each MPI process computes new values for the solution grid function at the points u(1:100,1:100) owned by the MPI process. Then the values at inter-process boundaries have to be exchanged with neighboring MPI processes. For example, the newly calculated values in u(1,1:100) must be sent into the halo cells u(101,1:100) of the left-hand neighbor with coordinates (own_coord(1)-1,own_coord(2)).

Image file


Set-up of MPI process structure for two-dimensional parallel Poisson solver

Image file


Communication routine with local data copying and sparse neighborhood alltoall

Image file


Communication routine with sparse neighborhood alltoallw and without local data copying

Image file


Two-dimensional parallel Poisson solver with persistent sparse neighborhood alltoallw and without local data copying


PreviousUpNext
Up: Virtual Topologies for MPI Processes Next: MPI Environmental Management Previous: Persistent Neighborhood Alltoall


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