The function
MPI_TYPE_VECTOR is a more general constructor that
allows replication of a datatype
into locations that consist of equally spaced blocks. Each block
is obtained by concatenating the same number of copies of the old datatype.
The spacing between blocks is a multiple of the extent of the old datatype.

MPI_TYPE_VECTOR( count, blocklength, stride, oldtype,
newtype)
[ IN count] number of blocks (nonnegative integer)
[ IN blocklength] number of elements in each block
(nonnegative integer)
[ IN stride] number of elements between start of each block (integer)
[ IN oldtype] old datatype (handle)
[ OUT newtype] new datatype (handle)

Assume, again, that oldtype has type map
with extent 16.
A call to MPI_TYPE_VECTOR( 2, 3, 4, oldtype, newtype) will
create the datatype with type map,

That is, two blocks with three copies each of the old
type, with a stride of 4 elements (
bytes) between the blocks.

A call to MPI_TYPE_VECTOR(3, 1, -2, oldtype, newtype) will create
the datatype,

In general, assume that oldtype has type map,

with extent ex. Let bl be the blocklength.
The newly created datatype has a type map with

entries:

A call to MPI_TYPE_CONTIGUOUS(count, oldtype, newtype) is
equivalent to a call to
MPI_TYPE_VECTOR(count, 1, 1, oldtype, newtype), or to a call to
MPI_TYPE_VECTOR(1, count, n, oldtype, newtype), n arbitrary.

*Hvector

The function MPI_TYPE_HVECTOR is identical to
MPI_TYPE_VECTOR, except that stride is given in bytes,
rather than in elements. The use for both types of vector
constructors is illustrated in Sec. Examples
.
( H stands for ``heterogeneous'').

MPI_TYPE_HVECTOR( count, blocklength, stride,
oldtype, newtype)
[ IN count] number of blocks (nonnegative integer)
[ IN blocklength] number of elements in each block
(nonnegative integer)
[ IN stride] number of bytes between start of each block (integer)
[ IN oldtype] old datatype (handle)
[ OUT newtype] new datatype (handle)

with extent ex. Let bl be the blocklength.
The newly created datatype has a type map with

entries:

*Indexed

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)
[ IN count] number of blocks -- also number of entries in
array_of_displacements and
array_of_blocklengths (nonnegative integer)
[ IN array_of_blocklengths] number of elements per block
(array of nonnegative integers)
[ IN array_of_displacements] displacement for each block,
in multiples of oldtype extent (array of integer)
[ IN oldtype] old datatype (handle)
[ OUT newtype] new datatype (handle)

That is, three copies of the old type starting at displacement
64, and one copy starting at displacement 0.

In general,
assume that oldtype has type map,

with extent ex.
Let B be the array_of_blocklength argument and
D be the
array_of_displacements argument. The newly created datatype
has
entries:

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

and

*Hindexed

The function MPI_TYPE_HINDEXED is identical to
MPI_TYPE_INDEXED, except that block displacements in
array_of_displacements are specified in
bytes, rather than in multiples of the oldtype extent.

MPI_TYPE_HINDEXED( count, array_of_blocklengths,
array_of_displacements, oldtype, newtype)
[ IN count] number of blocks -- also number of entries in
array_of_displacements and
array_of_blocklengths (integer)
[ IN array_of_blocklengths] number of elements in each block
(array of nonnegative integers)
[ IN array_of_displacements] byte displacement of each block
(array of integer)
[ IN oldtype] old datatype (handle)
[ OUT newtype] new datatype (handle)

with extent ex.
Let B be the array_of_blocklength argument and
D be the
array_of_displacements argument. The newly created datatype
has a type map with
entries:

*Struct

MPI_TYPE_STRUCT is the most general type constructor.
It further generalizes
the previous one in that it allows each block to consist of replications of
different datatypes.

MPI_TYPE_STRUCT(count, array_of_blocklengths,
array_of_displacements, array_of_types, newtype)
[ IN count] number of blocks (integer) -- also number of
entries in arrays array_of_types,
array_of_displacements and array_of_blocklengths
[ IN array_of_blocklength] number of elements in each block
(array of integer)
[ IN array_of_displacements] byte displacement of each block
(array of integer)
[ IN array_of_types] type of elements in each block (array
of handles to datatype objects)
[ OUT newtype] new datatype (handle)