next up previous contents
Next: Pack and unpack Up: Derived datatypes Previous: Derived datatypes   Contents

Revised definition of general datatype.

In the presence of MPI.LB, MPI.UB component types, an mpiJava general datatype can be represented by four things: For basic datatypes other than MPI.LB, MPI.UB the displacements take the form

\begin{eqnarray*}
\mbox{\em DispSeq} & = & \{0\} \\
\mbox{\em LBDisps} & = & \emptyset \\
\mbox{\em UBDisps} & = & \emptyset
\end{eqnarray*}

For MPI.LB they are

\begin{eqnarray*}
\mbox{\em DispSeq} & = & \emptyset \\
\mbox{\em LBDisps} & = & \{0\} \\
\mbox{\em UBDisps} & = & \emptyset
\end{eqnarray*}

For MPI.UB they are

\begin{eqnarray*}
\mbox{\em DispSeq} & = & \emptyset \\
\mbox{\em LBDisps} & = & \emptyset \\
\mbox{\em UBDisps} & = & \{0\}
\end{eqnarray*}

The two sets of pseudo-displacements are propagated to derived types by formulae identical to the ones given above for proper displacements. Below we will use the definition1

\begin{displaymath}
\mbox{\em AllDisps} = \mbox{\em DispSeq} \cup
\mbox{\em LBDisps} \cup \mbox{\em UBDisps}
\end{displaymath}

int Datatype.Extent()
returns: datatype extent



Returns the extent of a datatype. Java binding of the MPI operation MPI_TYPE_EXTENT. Return value is equal to

\begin{displaymath}
\mbox{\tt Ub()} - \mbox{\tt Lb()}
\end{displaymath}

int Datatype.Lb()
returns: displacement of lower bound from origin



Find the lower bound of a datatype. Java binding of the MPI operation MPI_TYPE_LB. If LBDisps is non-empty the return value of Lb is the least element of that set. Otherwise it is the least element of AllDisps2.

int Datatype.Ub()
returns: displacement of upper bound from origin



Find the upper bound of a datatype. Java binding of the MPI operation MPI_TYPE_UB. If UBDisps is non-empty the return value of Ub is the greatest element of that set. Otherwise it is

\begin{displaymath}
\max_{\mbox{\scriptsize\em disp} \in \mbox{\scriptsize\em AllDisps}}
\mbox{\em disp} + 1
\end{displaymath}

int Datatype.Size()
returns: datatype size



Returns the total size of the type. Java binding of the MPI operation MPI_TYPE_SIZE. Size is defined as the total number of buffer elements incorporated by the data type, or equivalently as the length of the displacement sequence. Unlike other language bindings, the size is not measured in bytes.

void Datatype.Commit()
Commit a derived datatype. Java binding of the MPI operation MPI_TYPE_COMMIT.

void Datatype.finalize()
Destructor. Java binding of the MPI operation MPI_TYPE_FREE.

int Status.Get_elements(Datatype datatype)
datatype datatype used by receive operation
   
returns: number of received basic elements



Retrieve number of basic elements from status. Java binding of the MPI operation MPI_GET_ELEMENTS.


next up previous contents
Next: Pack and unpack Up: Derived datatypes Previous: Derived datatypes   Contents
Bryan Carpenter 2002-07-12