20.1.14. Special Constants

PreviousUpNext
Up: Support for Fortran Next: Fortran Derived Types Previous: Problems Due to Data Copying and Sequence Association with Vector Subscripts

MPI requires a number of special ``constants'' that cannot be implemented as normal Fortran constants, e.g., MPI_BOTTOM. The complete list can be found in Section Named Constants. In C, these are implemented as constant pointers, usually as NULL and are used where the function prototype calls for a pointer to a variable, not the variable itself.

In Fortran, using special values for the constants (e.g., by defining them through parameter statements) is not possible because an implementation cannot distinguish these values from valid data. Typically these constants are implemented as predefined static variables (e.g., a variable in an MPI-declared COMMON block), relying on the fact that the target compiler passes data by address. Inside the subroutine, the address of the actual choice buffer argument can be compared with the address of such a predefined static variable.

These special constants also cause an exception with the usage of Fortran INTENT: with USE mpi_f08, the attributes INTENT(IN), INTENT(OUT), and INTENT(INOUT) are used in the Fortran interface. In most cases, INTENT(IN) is used if the C interface uses call-by-value. For all buffer arguments and for dummy arguments that may be modified and allow one of these special constants as input, an INTENT is not specified.


PreviousUpNext
Up: Support for Fortran Next: Fortran Derived Types Previous: Problems Due to Data Copying and Sequence Association with Vector Subscripts


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