The MPI Datatype Object Type

MPI provides the MPI_Datatype. The MPI datatype functions let you define and compose complex data types from simpler types so you can send these complex objects back and forth in messages. Datatypes ensure that a process receiving an object (in a message) will know the objects type — that the send type will match the receive type.

MPI provides datatype primitives (MPI_DOUBLE, MPI_INT, MPI_COMPLEX, etc). The user can compose datatypes from primitives and previously defined types in array- and struct-like arrangements.

Datatypes have attributes (key/value pairs) just like communicators.

MPI_Type_commit(..) is needed to define a type that is shared with other processes.