299. C++ Datatypes


Up: C++ Next: Communicators Previous: Semantics

Table 12 lists all of the C++ predefined MPI datatypes and their corresponding C and C++ datatypes, Table 13 lists all of the Fortran predefined MPI datatypes and their corresponding Fortran 77 datatypes. Table 14 lists the C++ names for all other MPI datatypes.

MPI::BYTE and MPI::PACKED conform to the same restrictions as MPI_BYTE and MPI_PACKED, listed in Sections Message Data on page Message Data and Sections Pack and Unpack on page Pack and Unpack , respectively.

MPI datatype C datatype C++ datatype
MPI::CHAR char char
MPI::SHORT signed short signed short
MPI::INT signed int signed int
MPI::LONG signed long signed long
MPI::LONG_LONG signed long long signed long long
MPI::SIGNED_CHAR signed char signed char
MPI::UNSIGNED_CHAR unsigned char unsigned char
MPI::UNSIGNED_SHORT unsigned short unsigned short
MPI::UNSIGNED unsigned int unsigned int
MPI::UNSIGNED_LONG unsigned long unsigned long int
MPI::UNSIGNED_LONG_LONG unsigned long long unsigned long long
MPI::FLOAT float float
MPI::DOUBLE double double
MPI::LONG_DOUBLE long double long double
MPI::BOOL bool
MPI::COMPLEX Complex<float>
MPI::DOUBLE_COMPLEX Complex<double>
MPI::LONG_DOUBLE_COMPLEX Complex<long double>
MPI::WCHAR wchar_t wchar_t
MPI::BYTE
MPI::PACKED

Table 12: C++ names for the MPI C and C++ predefined datatypes, and their corresponding C/C++ datatypes.

MPI datatype Fortran datatype
MPI::INTEGER INTEGER
MPI::REAL REAL
MPI::DOUBLE_PRECISION DOUBLE PRECISION
MPI::F_COMPLEX COMPLEX
MPI::LOGICAL LOGICAL
MPI::CHARACTER CHARACTER(1)
MPI::BYTE
MPI::PACKED

Table 13: C++ names for the MPI Fortran predefined datatypes, and their corresponding Fortran 77 datatypes.

MPI datatype Description
MPI::FLOAT_INT C/C++ reduction type
MPI::DOUBLE_INT C/C++ reduction type
MPI::LONG_INT C/C++ reduction type
MPI::TWOINT C/C++ reduction type
MPI::SHORT_INT C/C++ reduction type
MPI::LONG_DOUBLE_INT C/C++ reduction type
MPI::TWOREAL Fortran reduction type
MPI::TWODOUBLE_PRECISION Fortran reduction type
MPI::TWOINTEGER Fortran reduction type
MPI::F_DOUBLE_COMPLEX Optional Fortran type
MPI::INTEGER1 Explicit size type
MPI::INTEGER2 Explicit size type
MPI::INTEGER4 Explicit size type
MPI::INTEGER8 Explicit size type
MPI::REAL4 Explicit size type
MPI::REAL8 Explicit size type
MPI::REAL16 Explicit size type

Table 14: C++ names for other MPI datatypes. Implementations may also define other optional types (e.g.,  MPI::INTEGER8).

The following table defines groups of MPI predefined datatypes:
C integer: MPI::INT, MPI::LONG, MPI::SHORT,
MPI::UNSIGNED_SHORT, MPI::UNSIGNED,
MPI::UNSIGNED_LONG,
MPI::_LONG_LONG, MPI::UNSIGNED_LONG_LONG,
MPI::SIGNED_CHAR, MPI::UNSIGNED_CHAR
Fortran integer: MPI::INTEGER
Floating point: MPI::FLOAT, MPI::DOUBLE, MPI::REAL,
MPI::DOUBLE_PRECISION,
MPI::LONG_DOUBLE
Logical: MPI::LOGICAL, MPI::BOOL
Complex: MPI::F_COMPLEX, MPI::COMPLEX,
MPI::F_DOUBLE_COMPLEX,
MPI::DOUBLE_COMPLEX,
MPI::LONG_DOUBLE_COMPLEX
Byte: MPI::BYTE

Valid datatypes for each reduction operation are specified below in terms of the groups defined above.


Op Allowed Types

MPI::MAX, MPI::MIN C integer, Fortran integer, Floating point
MPI::SUM, MPI::PROD C integer, Fortran integer, Floating point, Complex
MPI::LAND, MPI::LOR, MPI::LXOR C integer, Logical
MPI::BAND, MPI::BOR, MPI::BXOR C integer, Fortran integer, Byte

MPI::MINLOC and MPI::MAXLOC perform just as their C and Fortran counterparts; see Section MINLOC and MAXLOC on page MINLOC and MAXLOC .



Up: C++ Next: Communicators Previous: Semantics


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

MPI-2.0 of July 1, 2008
HTML Generated on July 6, 2008