21.5. Handle Constants

PreviousUpNext
Up: Application Binary Interface (ABI) Next: Language Bindings Summary Previous: Handle Serialization

Predefined handle constants are represented as integers in the range 1 to 4095. To make it easy for implementations and tools to decode handle constants, their values are derived from a Huffman code. The Huffman code currently uses the lower 10 bits of the 12 bits allocated above. In the following, we will describe constants in their binary representation, 0b***_***_***_***, where underscores are added for readability. We count bits from the right starting from zero; the rightmost three bits will be denoted 2:0.

Datatypes are the most common type of predefined handle and use the range 0b00_10_********. Bits 7:3 identify the category and the bits 2:0 identify the specific instances thereof. The first set of predefined datatypes are not fixed-sized. While long has a fixed size for a given platform ABI, it is not fixed across all platforms. In contrast, types like int32_t and REAL*8 (or its Fortran standard equivalents) have the same size on all platforms. Fixed-sized types allow the implementation to determine the size of the datatype from the predefined handle value itself, without a lookup table.


Table 30: Predefined MPI datatype categories and instance values, for types without a specified size. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00000 Language-independent types
000 MPI_DATATYPE_NULL
001 MPI_AINT
010 MPI_COUNT
011 MPI_OFFSET
111 MPI_PACKED

Table 31: Predefined MPI datatype categories and instance values, for types without a specified size. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00001 C integer types
000 MPI_SHORT
001 MPI_INT
010 MPI_LONG
011 MPI_LONG_LONG
100 MPI_UNSIGNED_SHORT
101 MPI_UNSIGNED
110 MPI_UNSIGNED_LONG
111 MPI_UNSIGNED_LONG_LONG

Table 32: Predefined MPI datatype categories and instance values, for types without a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00010 C/C++ floating-
point types
000 MPI_FLOAT
001 MPI_C_FLOAT_COMPLEX
010 MPI_CXX_FLOAT_COMPLEX
100 MPI_DOUBLE
101 MPI_C_DOUBLE_COMPLEX
110 MPI_CXX_DOUBLE_COMPLEX

Table 33: Predefined MPI datatype categories and instance values, for types without a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00011 Fortran types
000 MPI_LOGICAL
001 MPI_INTEGER
010 MPI_REAL
011 MPI_COMPLEX
100 MPI_DOUBLE_PRECISION
101 MPI_DOUBLE_COMPLEX
110 MPI_CHARACTER

Table 34: Predefined MPI datatype categories and instance values, for types without a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00100 Long double
types
000 MPI_LONG_DOUBLE
100 MPI_C_LONG_DOUBLE_COMPLEX
101 MPI_CXX_LONG_DOUBLE_COMPLEX

Table 35: Predefined MPI datatype categories and instance values, for types without a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00101 C pair types
000 MPI_FLOAT_INT
001 MPI_DOUBLE_INT
010 MPI_LONG_INT
011 MPI_2INT
100 MPI_SHORT_INT
101 MPI_LONG_DOUBLE_INT
0010 00110 Fortran pair types
000 MPI_2REAL
001 MPI_2DOUBLE_PRECISION
010 MPI_2INTEGER

Table 36: Predefined MPI datatype categories and instance values, for types without a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 00111 Other C/C++ types
000 MPI_C_BOOL
001 MPI_CXX_BOOL
100 MPI_WCHAR
The Huffman code for fixed-size types encodes the base-2 logarithm of the type size in bits 5:3. Implemenations can identify datatypes with fixed-size using bit 6.


Table 37: Predefined MPI datatype categories and instance values, for types with a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 01000 1-byte C/C++ types
000 MPI_INT8_T
001 MPI_UINT8_T
011 MPI_CHAR
100 MPI_SIGNED_CHAR
101 MPI_UNSIGNED_CHAR
111 MPI_BYTE
0010 01001 2-byte C/C++ types
000 MPI_INT16_T
001 MPI_UINT16_T
0010 01010 4-byte C/C++ types
000 MPI_INT32_T
001 MPI_UINT32_T
0010 01011 8-byte C/C++ types
000 MPI_INT64_T
001 MPI_UINT64_T

Table 38: Predefined MPI datatype categories and instance values, for types with a specified width. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0010 11000 1-byte Fortran types
000 MPI_LOGICAL1
001 MPI_INTEGER1
0010 11001 2-byte Fortran types
000 MPI_LOGICAL2
001 MPI_INTEGER2
010 MPI_REAL2
0010 11010 4-byte Fortran types
000 MPI_LOGICAL4
001 MPI_INTEGER4
010 MPI_REAL4
011 MPI_COMPLEX4
0010 11011 8-byte Fortran types
000 MPI_LOGICAL8
001 MPI_INTEGER8
010 MPI_REAL8
011 MPI_COMPLEX8
0010 11100 16-byte Fortran types
000 MPI_LOGICAL16
001 MPI_INTEGER16
010 MPI_REAL16
011 MPI_COMPLEX16
0010 11101 32-byte Fortran types
011 MPI_COMPLEX32
Reduction operators use the range 0b00_00_001_***** and the predefined values fall into four categories: arithmetic, bit-wise, logical, and other.

All other predefined handles use the range 0b00_01_********. In general, predefined null handles have all zero bits other than those required to detect the handle type.


Table 39: Predefined MPI_Op categories and instance values. All unassigned values are reserved.

Bits 11:5 Bits 4:3 Bits 2:0 Category Instance
0000001 00 Arithmetic operations
000 MPI_OP_NULL
001 MPI_SUM
010 MPI_MIN
011 MPI_MAX
100 MPI_PROD
0000001 01 Bit operations
000 MPI_BAND
001 MPI_BOR
010 MPI_BXOR
0000001 10 Logical operations
000 MPI_LAND
001 MPI_LOR
010 MPI_LXOR
0000001 11 Other operations
000 MPI_MINLOC
001 MPI_MAXLOC
100 MPI_REPLACE
101 MPI_NO_OP

Table 40: Predefined MPI handle categories and instance values. All unassigned values are reserved.

Bits 11:8 Bits 7:3 Bits 2:0 Category Instance
0001 00000 Communicators
000 MPI_COMM_NULL
001 MPI_COMM_WORLD
010 MPI_COMM_SELF

0001

00001 Group
000 MPI_GROUP_NULL
001 MPI_GROUP_EMPTY

0001

00010 Windows
000 MPI_WIN_NULL

0001

00011 Files
000 MPI_FILE_NULL

0001

00100 Sessions
000 MPI_SESSION_NULL

0001

00101 Messages
000 MPI_MESSAGE_NULL
001 MPI_MESSAGE_NO_PROC

0001

00110 Info
000 MPI_INFO_NULL
001 MPI_INFO_ENV

0001

01000 Errhandlers
000 MPI_ERRHANDLER_NULL
001 MPI_ERRORS_ARE_FATAL
010 MPI_ERRORS_RETURN
011 MPI_ERRORS_ABORT

0001

10000 Requests
000 MPI_REQUEST_NULL


PreviousUpNext
Up: Application Binary Interface (ABI) Next: Language Bindings Summary Previous: Handle Serialization


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

(Unofficial) MPI-5.0 of June 9, 2025
HTML Generated on March 2, 2025