It is often convenient to define explicitly the lower bound and upper
bound of a type map, and override the definition given
on page .
This allows one to define a datatype that
has ``holes'' at its beginning or its end, or a datatype with
entries that extend above the upper bound or below the lower bound.
Examples of
such usage are provided in Sec. 3.12.7.
Also, the user may want to overide the alignment rules that are
used to compute upper bounds and extents. E.g., a C compiler may allow
the user to overide default alignment rules for some of the
structures within
a program. The user has to specify explicitly the bounds of the datatypes
that match these structures.
To achieve this, we add
two additional ``pseudo-datatypes,'' MPI_LB and MPI_UB,
that can be used, respectively, to mark the lower bound or the upper
bound of a datatype. These pseudo-datatypes occupy no space
(
). They do not
affect the size or count of a datatype, and do not affect the
the content of a message created with this datatype(Enhancement/Correction in the MPI-1.2 Standard:
). However, they do
affect the definition of the
extent of a datatype and, therefore, affect the outcome of a replication of
this datatype by a datatype constructor.
In general, if
Similarly,
the upper bound of is defined to be
The formal definitions given for the various datatype constructors apply now, with the amended definition of extent.
The two functions below can be used for finding the lower bound and the upper bound of a datatype.
MPI_TYPE_LB( datatype, displacement)
int MPI_Type_lb(MPI_Datatype datatype, MPI_Aint* displacement)
MPI_TYPE_LB( DATATYPE, DISPLACEMENT, IERROR)
INTEGER DATATYPE, DISPLACEMENT, IERROR
MPI_TYPE_UB( datatype, displacement)
int MPI_Type_ub(MPI_Datatype datatype, MPI_Aint* displacement)
MPI_TYPE_UB( DATATYPE, DISPLACEMENT, IERROR)
INTEGER DATATYPE, DISPLACEMENT, IERROR
MPI-Standard for MARMOT