MPI_TYPE_UB, MPI_Type_ub Purpose Returns the upper bound of a datatype. C synopsis #include int MPI_Type_ub(MPI_Datatype datatype,MPI_Aint *displacement); FORTRAN synopsis include 'mpif.h' or use mpi MPI_TYPE_UB(INTEGER DATATYPE,INTEGER DISPLACEMENT, INTEGER IERROR) Parameters datatype is the datatype (handle) (IN) displacement is the displacement of the upper bound from the origin, in bytes (integer) (OUT) IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine returns the upper bound of a specific datatype. The upper bound is the displacement you use in locating the origin byte of the next instance of datatype for operations that use count and datatype. In the normal case, ub represents the displacement of the highest address byte of the datatype + e (where e >= 0 and results in (ub - lb) being a multiple of the boundary requirement for the most boundary constrained type in the datatype). If MPI_UB is used in a type constructor, no alignment adjustment is done so ub is exactly as you set it. For a type with MPI_UB in its ancestry, the value returned by MPI_TYPE_UB may not be related to the displacement of the highest address byte (with rounding). Refer to MPI_TYPE_STRUCT for more informatin on MPI_LB and MPI_UB. Notes MPI_TYPE_GET_EXTENT supersedes MPI_TYPE_UB. For FORTRAN 64-bit codes, an INTEGER may not be enough to represent the upper bound. When the upper bound is known to be representable by an INTEGER, this subroutine remains usable at your own risk. New codes should always use MPI_TYPE_GET_EXTENT. Errors Invalid datatype MPI not initialized MPI already finalized Related information MPI_TYPE_LB