## 9.5.2. External Data Representation: ``external32''

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 [9] of the appropriate size. Floating point values are represented by one of three IEEE formats. These are the IEEE ``Single,'' ``Double,'' and ``Double Extended'' formats, requiring 4, 8 and 16 bytes of storage, respectively. For the IEEE ``Double Extended'' formats, MPI specifies a Format Width of 16 bytes, with 15 exponent bits, bias = +10383, 112 fraction bits, and an encoding analogous to the ``Double'' format. All integral values are in two's complement big-endian format. Big-endian means most significant byte at lowest address byte. For Fortran `LOGICAL` and C++ `bool`, 0 implies false and nonzero implies true. Fortran `COMPLEX` and `DOUBLE COMPLEX` are represented by a pair of floating point format values for the real and imaginary components. Characters are in ISO 8859-1 format [10]. Wide characters (of type MPI_WCHAR) are in Unicode format [23].

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 [9], 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 (see ftp://ds.internic.net/rfc/rfc1832.txt). ( End of advice to implementors.)

All data is byte aligned, regardless of type. All data items are stored contiguously in the file.

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

            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_UNSIGNED              4
            MPI_LONG                  4
            MPI_UNSIGNED_LONG         4
            MPI_FLOAT                 4
            MPI_DOUBLE                8
            MPI_LONG_DOUBLE          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

            Optional Type         Length
            ------------------    ------
            MPI_INTEGER1              1
            MPI_INTEGER2              2
            MPI_INTEGER4              4
            MPI_INTEGER8              8
            MPI_LONG_LONG             8
            MPI_UNSIGNED_LONG_LONG    8

            MPI_REAL4                 4
            MPI_REAL8                 8
            MPI_REAL16               16

The size 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 .

Advice to implementors.

When converting a larger size integer to a smaller size integer, only the less 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.)

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

Return to MPI-2 Standard Index
Return to MPI 1.1 Standard Index
Return to MPI Forum Home Page

MPI-2.0 of July 18, 1997
HTML Generated on September 10, 2001