Hvector



next up previous contents
Next: Indexed Up: Datatype Constructors Previous: Vector

Hvector

The Vector type constructor assumes that the stride between successive blocks is a multiple of the oldtype extent. This avoids, most of the time, the need for computing stride in bytes. Sometimes it is useful to relax this assumption and allow a stride which consists of an arbitrary number of bytes. The Hvector type constructor below achieves this purpose. The usage of both Vector and Hvector is illustrated in Examples gif-gif.

MPI_TYPE_HVECTOR(count, blocklength, stride, oldtype, newtype)

  IN        count             number of blocks
  IN        blocklength       number of elements in each block
  IN        stride            spacing between start of each block,
                              measured as number of elements
  IN        oldtype           old datatype
  OUT       newtype           new datatype

MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype)

MPI_TYPE_HVECTOR(COUNT, BLOCKLENGTH, STRIDE, OLDTYPE, NEWTYPE, IERROR)INTEGER COUNT, BLOCKLENGTH, STRIDE, OLDTYPE, NEWTYPE, IERROR

MPI_TYPE_HVECTOR is identical to MPI_TYPE_VECTOR, except that stride is given in bytes, rather than in elements. (H stands for ``heterogeneous''). The action of the Hvector constructor is represented schematically in Figure gif.


Figure: Memory layout of 2D array section for Example gif. The shaded blocks are sent.



Jack Dongarra
Fri Sep 1 06:16:55 EDT 1995