The function MPI_TYPE_INDEXED allows replication of an old datatype into a sequence of blocks (each block is a concatenation of the old datatype), where each block can contain a different number of copies and have a different displacement. All block displacements are multiples of the old type extent.
MPI_TYPE_INDEXED( count, array_of_blocklengths,
array_of_displacements, oldtype, newtype)
int MPI_Type_indexed(int count, int *array_of_blocklengths, int *array_of_displacements, MPI_Datatype oldtype, MPI_Datatype *newtype)
MPI_TYPE_INDEXED(COUNT, ARRAY_OF_BLOCKLENGTHS, ARRAY_OF_DISPLACEMENTS, OLDTYPE, NEWTYPE, IERROR)
INTEGER COUNT, ARRAY_OF_BLOCKLENGTHS(*), ARRAY_OF_DISPLACEMENTS(*), OLDTYPE, NEWTYPE, IERROR
Let oldtype have type map
with extent 16.
Let B = (3, 1) and let D = (4, 0). A call to
MPI_TYPE_INDEXED(2, B, D, oldtype, newtype) returns a datatype with
type map,
In general,
assume that oldtype has type map,
A call to MPI_TYPE_VECTOR(count, blocklength, stride, oldtype,
newtype) is equivalent to a call to
MPI_TYPE_INDEXED(count, B, D, oldtype, newtype) where
MPI-Standard for MARMOT