15.5.2. External Data Representation: "external32"

PreviousUpNext
Up: File Interoperability Next: User-Defined Data Representations Previous: Datatypes for File Interoperability

All MPI implementations are required to support the data representation defined in this section. Support of optional datatypes (e.g., MPI_INTEGER2) is not required.

All floating point values are in big-endian IEEE format [43] of the appropriate size. Floating point values are represented by one of three IEEE formats. These are the IEEE ``Single (binary32),'' ``Double (binary64),'' and ``Double Extended (binary128)'' formats, requiring 4, 8, and 16 bytes of storage, respectively. For the IEEE ``Double Extended (binary128)'' formats, MPI specifies a format width of 16 bytes, with 15 exponent bits, bias = +16383, 112 fraction bits, and an encoding analogous to the ``Double (binary64)'' format. All integral values are in two's complement big-endian format. Big-endian means most significant byte at lowest address byte. For C _Bool, Fortran LOGICAL, and C++ bool, 0 implies false and nonzero implies true. C float _Complex, double _Complex, and long double _Complex, Fortran COMPLEX and DOUBLE COMPLEX, and other complex types are represented by a pair of floating point format values for the real and imaginary components. Characters are in ISO 8859-1 format [44]. Wide characters (of type MPI_WCHAR) are in Unicode format [69].

All signed numerals (e.g., MPI_INT, MPI_REAL) have the sign bit at the most significant bit. MPI_COMPLEX and MPI_DOUBLE_COMPLEX have the sign bit of the real and imaginary parts at the most significant bit of each part.

According to IEEE specifications [43], the ``NaN'' (not a number) is system dependent. It should not be interpreted within MPI as anything other than ``NaN.''


Advice to implementors.

The MPI treatment of ``NaN'' is similar to the approach used in XDR [66]. ( End of advice to implementors.)
All data is byte aligned, regardless of type. All data items are stored contiguously in the file (if the file view is contiguous).


Advice to implementors.

All bytes of LOGICAL and bool must be checked to determine the value. ( End of advice to implementors.)

Advice to users.

The type MPI_PACKED is treated as bytes and is not converted. The user should be aware that MPI_PACK has the option of placing a header in the beginning of the pack buffer. ( End of advice to users.)

Table 13: "external32" sizes of predefined datatypes

Predefined Type Length
MPI_PACKED 1
MPI_BYTE 1
MPI_CHAR 1
MPI_UNSIGNED_CHAR 1
MPI_SIGNED_CHAR 1
MPI_WCHAR 2
MPI_SHORT 2
MPI_UNSIGNED_SHORT 2
MPI_INT 4
MPI_LONG 4
MPI_UNSIGNED 4
MPI_UNSIGNED_LONG 4
MPI_LONG_LONG_INT 8
MPI_UNSIGNED_LONG_LONG 8
MPI_FLOAT 4
MPI_DOUBLE 8
MPI_LONG_DOUBLE 16
MPI_C_BOOL 1
MPI_INT8_T 1
MPI_INT16_T 2
MPI_INT32_T 4
MPI_INT64_T 8
MPI_UINT8_T 1
MPI_UINT16_T 2
MPI_UINT32_T 4
MPI_UINT64_T 8
MPI_AINT 8
MPI_COUNT 8
MPI_OFFSET 8
MPI_C_COMPLEX 2*4
MPI_C_FLOAT_COMPLEX 2*4
MPI_C_DOUBLE_COMPLEX 2*8
MPI_C_LONG_DOUBLE_COMPLEX 2*16
MPI_CHARACTER 1
MPI_LOGICAL 4
MPI_INTEGER 4
MPI_REAL 4
MPI_DOUBLE_PRECISION 8
MPI_COMPLEX 2*4
MPI_DOUBLE_COMPLEX 2*8
MPI_CXX_BOOL 1
MPI_CXX_FLOAT_COMPLEX 2*4
MPI_CXX_DOUBLE_COMPLEX 2*8
MPI_CXX_LONG_DOUBLE_COMPLEX 2*16

Table 14: "external32" sizes of optional datatypes

Predefined Type Length
MPI_INTEGER1 1
MPI_INTEGER2 2
MPI_INTEGER4 4
MPI_INTEGER8 8
MPI_INTEGER16 16
MPI_REAL2 2
MPI_REAL4 4
MPI_REAL8 8
MPI_REAL16 16
MPI_COMPLEX4 2*2
MPI_COMPLEX8 2*4
MPI_COMPLEX16 2*8
MPI_COMPLEX32 2*16

Table 15: "external32" sizes of C++ datatypes

C++ Types Length
MPI_CXX_BOOL 1
MPI_CXX_FLOAT_COMPLEX 2*4
MPI_CXX_DOUBLE_COMPLEX 2*8
MPI_CXX_LONG_DOUBLE_COMPLEX 2*16
The sizes of the predefined datatypes returned from MPI_TYPE_CREATE_F90_REAL, MPI_TYPE_CREATE_F90_COMPLEX, and MPI_TYPE_CREATE_F90_INTEGER are defined in Section Additional Support for Fortran Numeric Intrinsic Types, page Parameterized Datatypes with Specified Precision and Exponent Range.


Advice to implementors.

When converting a larger size integer to a smaller size integer, only the least significant bytes are moved. Care must be taken to preserve the sign bit value. This allows no conversion errors if the data range is within the range of the smaller size integer. ( End of advice to implementors.)
Table 13, 14, and 15 specify the sizes of predefined, optional, and C++ datatypes in "external32" format, respectively.


PreviousUpNext
Up: File Interoperability Next: User-Defined Data Representations Previous: Datatypes for File Interoperability


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023