Derived Data Types

4.2.3 Use Datatype

Derived datatypes can be used in all send and receive operations. You simply use the handle to the derived datatype as an argument in a send or receive operation instead of a basic datatype argument. Here is a sample C code segment:

MPI_Type_vector(count, blocklength, stride, oldtype, &newtype);
MPI_Type_commit (&newtype);
MPI_Send(buffer, 1, newtype, dest, tag, comm);

What happens if you are using a derived datatype and the count in MPI_SEND is greater than one? Happily, it's just as you would expect: MPI_SEND acts as if it were passed a new datatype that is count concatenations of datatype.