3.5.6. Absolute Addresses and Relative Address Displacements

PreviousUpNext
Up: Datatypes Next: File Offsets Previous: Choice

Some MPI procedures use address arguments that represent an absolute address in the calling program, or relative displacement arguments that represent differences of two absolute addresses. The datatype of such arguments is MPI_Aint in C andINTEGER(KIND=MPI_ADDRESS_KIND) in Fortran. These types must have the same width and encode address values in the same manner such that address values in one language may be passed directly to another language without conversion. There is the MPI constant MPI_BOTTOM to indicate the start of the address range. For retrieving absolute addresses or any calculation with absolute addresses, one should use the routines and functions provided in Section Address and Size Procedures. Section Correct Use of Addresses provides additional rules for the correct use of absolute addresses. For expressions with relative displacements or other usage without absolute addresses, intrinsic operators (e.g., +, -, *) can be used.


Rationale.

Byte displacement values need to be large enough to encode any value used for expressing absolute or relative memory addresses. Prior to MPI-4.0, some MPI routines used int in C and INTEGER in Fortran as the type for byte displacement arguments. To avoid breaking backward compatibility, this version of the standard continues to support int in C as well as INTEGER in Fortran in such routines. In addition, this version of the standard supports using MPI_Aint in C (via separate ``_c'' suffixed procedures) as well as INTEGER(KIND=MPI_ADDRESS_KIND) in Fortran (via polymorphic interfaces in newer MPI Fortran bindings (USE mpi_f08)) in such routines. See Section Support for Large Count and Large Byte Displacement in MPI Language Bindings for a full explanation. ( End of rationale.)


PreviousUpNext
Up: Datatypes Next: File Offsets Previous: Choice


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