Hindexed



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

Hindexed

As with the Vector and Hvector constructors, it is usually convenient to measure displacements in multiples of the extent of the oldtype, but sometimes necessary to allow for arbitrary displacements. The Hindexed constructor satisfies the later need.

MPI_TYPE_HINDEXED(count, array_of_blocklengths, array_of_displacements,
                    oldtype, newtype)
   IN        count                       number of blocks
   IN        array_of_blocklengths       number of elements per block
   IN        array_of_displacements      byte displacement for each block
   IN        oldtype                     old datatype
   OUT       newtype                     new datatype

MPI_Type_hindexed(int count, int *array_of_blocklengths, MPI_Aint *array_of_displacements, MPI_Datatype oldtype, MPI_Datatype *newtype)

MPI_TYPE_HINDEXED(COUNT, ARRAY_OF_BLOCKLENGTHS, ARRAY_OF_DISPLACEMENTS, OLDTYPE, NEWTYPE, IERROR)INTEGER COUNT, ARRAY_OF_BLOCKLENGTHS(*), ARRAY_OF_DISPLACEMENTS(*), OLDTYPE, NEWTYPE, IERROR

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. The action of the Hindexed constructor is represented schematically in Figure gif.



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