6.1.14. Examples

PreviousUpNext
Up: Derived Datatypes Next: Pack and Unpack Previous: Decoding a Datatype

The following examples illustrate the use of derived datatypes.


Example Send and receive a section of a 3D array.

Image file


Example Copy the (strictly) lower triangular part of a matrix.

Image file


Example Transpose a matrix.

Image file


Example Another approach to the transpose problem:

Image file


Example Use of MPI datatypes to manipulate an array of structures.

Image file


Example The same manipulations as in the previous example, but use absolute addresses in datatypes.

Image file


Example This example shows how datatypes can be used to handle unions.

Image file


Example This example shows how a datatype can be decoded. The routine printdatatype prints out the elements of the datatype. Note the use of MPI_Type_free for datatypes that are not predefined.

Image file


PreviousUpNext
Up: Derived Datatypes Next: Pack and Unpack Previous: Decoding a Datatype


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