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)

int 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






Assume that oldtype has type map,

\begin{displaymath}
\{ (type_0,disp_0), ..., (type_{n-1}, disp_{n-1}) \} ,
\end{displaymath}

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 $n \cdot \sum_{i=0}^{{\sf count}-1}
{\sf B[i]}$ entries:

\begin{displaymath}
\{
(type_0, disp_0 + {\sf D[0]} ) , ... ,
(type_{n-1} , disp_{n-1} + {\sf D[0]} ) , ... ,
\end{displaymath}


\begin{displaymath}
(type_0 , disp_0 + {\sf D[0]} +({\sf B[0]} -1) \cdot ex) ,...,
\end{displaymath}


\begin{displaymath}
(type_{n-1} , disp_{n-1} + {\sf D[0]} +({\sf B[0]} -1) \cdot ex ) ,
...,
\end{displaymath}


\begin{displaymath}
(type_0, disp_0 + {\sf D[count-1]} ) , ... ,
(type_{n-1} , disp_{n-1} + {\sf D[count-1]} ) , ... ,
\end{displaymath}


\begin{displaymath}
(type_0 , disp_0 + {\sf D[count-1]} +({\sf B[count-1]} -1) \cdot ex)
,...,
\end{displaymath}


\begin{displaymath}
(type_{n-1} , disp_{n-1} + {\sf D[count-1]} +({\sf B[count-1]} -1)
\cdot ex )
\} .
\end{displaymath}




MPI-Standard for MARMOT