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. 3.12.7. (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)

int 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






Assume that oldtype has type map,

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

with extent $ex$. Let bl be the blocklength. The newly created datatype has a type map with ${\sf count} \cdot {\sf bl} \cdot n$ entries:

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


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


\begin{displaymath}
(type_0 , disp_0 + ({\sf bl} -1) \cdot ex
) , ... , (type_{n-1} , disp_{n-1} + ({\sf bl} -1) \cdot ex ) ,
\end{displaymath}


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


\begin{displaymath}
(type_0 , disp_0 + {\sf stride} + ( {\sf bl} -1) \cdot ex
) , ... ,
\end{displaymath}


\begin{displaymath}
(type_{n-1}, disp_{n-1} + {\sf stride} + ({\sf bl} -1) \cdot
ex ) ,
....,
\end{displaymath}


\begin{displaymath}
(type_0 ,disp_0 + {\sf stride} \cdot ({\sf count}-1) ) , ......
...} , disp_{n-1} + {\sf stride} \cdot ({\sf count} -1) )
, ... ,
\end{displaymath}


\begin{displaymath}
(type_0 , disp_0 + {\sf stride} \cdot ({\sf count} -1)
+ ({\sf bl} -1) \cdot ex ) , ... ,
\end{displaymath}


\begin{displaymath}
(type_{n-1}, disp_{n-1} + {\sf stride} \cdot ({\sf count} -1)
+ ({\sf bl} -1) \cdot ex )
\} .
\end{displaymath}




MPI-Standard for MARMOT