7.6.1. Examples using MPI_SCATTER, MPI_SCATTERV

PreviousUpNext
Up: Scatter Next: Gather-to-all Previous: Scatter

The examples in this section use intra-communicators.


Example The reverse of Example Examples using MPI_GATHER, MPI_GATHERV. Scatter sets of 100 ints from the root to each MPI process in the group. See Figure 12.

Image file

Image file


Figure 12: The root scatters sets of 100 ints to each MPI process in the group.


Example The reverse of Example Examples using MPI_GATHER, MPI_GATHERV. The root scatters sets of 100 ints to the other MPI processes, but the sets of 100 are stride ints apart in the sending buffer. Requires use of MPI_SCATTERV. Assume stride ≤ 100. See Figure 13.

Image file

Image file


Figure 13: The root scatters sets of 100 ints, moving by stride ints from send to send in the scatter.


Example The reverse of Example Examples using MPI_GATHER, MPI_GATHERV. We have a varying stride between blocks at sending (root) end, at the receiving end we receive into the i-th column of a 100×150 C array. See Figure 14.

Image file

Image file


Figure 14: The root scatters blocks of 100-i ints into column i of a 100$ x $150 C array. At the sending side, the blocks are stride[i] ints apart.


PreviousUpNext
Up: Scatter Next: Gather-to-all Previous: Scatter


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