20.2. Support for Large Count and Large Byte Displacement in MPI Language Bindings

PreviousUpNext
Up: Language Bindings Next: Language Interoperability Previous: Comparison with C

The following types, which were used prior to MPI-4.0, have been deemed too small to hold values that applications wish to use:


In order to avoid breaking backwards compatibility, this version of MPI supports larger types via separate additional MPI procedures in C (suffixed with ``_c'')and via interface polymorphism in Fortran when using USE mpi_f08. For better readability, all Fortran large count procedure declarations are marked with a comment ``!(_c)''.No polymorphic support for larger types is provided in Fortran when using mpif.h and use mpi.

For the large count versions of three datatype constructors, MPI_TYPE_CREATE_HINDEXED, MPI_TYPE_CREATE_HINDEXED_BLOCK, and MPI_TYPE_CREATE_STRUCT, absolute addresses shall not be used to specify byte displacements since the parameter is of type MPI_COUNT instead of type MPI_AINT (see Section Counts).

In addition, the functions MPI_TYPE_GET_ENVELOPE and MPI_TYPE_GET_CONTENTS also support large count types via additional parameters in separate additional MPI procedures in C (suffixed with ``_c'') and interface polymorphism in Fortran when using USE mpi_f08 (see Section Decoding a Datatype).

Further, the callbacks of type MPI_User_function and MPI_Datarep_conversion_function also support large count types via separate additional callback prototypes in C (suffixed with ``_c'') and multiple abstract interfaces in Fortran when using USE mpi_f08 (see Sections User-Defined Reduction Operations and Datarep Conversion Functions, respectively). An additional large count predefined callback function MPI_CONVERSION_FN_NULL_C is provided within each of these two language bindings.

In C bindings, for each MPI procedure that had at least one count or byte displacement parameter that used the int and/or MPI_Aint types prior to MPI-4.0, an additional MPI procedure is provided, with the same name but suffixed by ``_c''. The MPI procedure without the ``_c'' token has the same name and parameter types as versions prior to MPI-4.0. The ``_c'' suffixed MPI procedure has MPI_Count for all count parameters, MPI_Aint for parameters that represent byte displacement in memory, MPI_Offset for parameters that represent byte displacement in files, and MPI_Count for parameters that may represent byte displacement in both memory and files.

In Fortran, when using USE mpi_f08, for each MPI procedure that had at least one count or byte displacement parameter that used the INTEGER or INTEGER(KIND=MPI_ADDRESS_KIND) types prior to MPI-4.0, a polymorphic interface containing two specific procedures is provided. One of the specific procedures has the same name and dummy parameter types as in versions prior to MPI-4.0. INTEGER and/or INTEGER(KIND=MPI_ADDRESS_KIND) for count and byte displacement parameters. The other specific procedure has the same name followed by ``_c'', and then suffixed by the token specified in Table 28 for USE mpi_f08. It also has INTEGER(KIND=MPI_COUNT_KIND) for all count parameters, INTEGER(KIND=MPI_ADDRESS_KIND) for parameters that represent byte displacement in memory, INTEGER(KIND=MPI_OFFSET_KIND) for parameters that represent byte displacement in files, and INTEGER(KIND=MPI_COUNT_KIND) for parameters that may represent byte displacement in both memory and files (for more details on specific Fortran procedure names and related calling conventions, refer to Table 28 in Section Interface Specifications, Procedure Names, and the Profiling Interface). There is one exception: if the type signatures of the two specific procedures are identical (e.g., if INTEGER(KIND=MPI_COUNT_KIND) is the same type as INTEGER(KIND=MPI_ADDRESS_KIND) ), then the implementation shall not provide the ``_c'' specific procedure.

It is erroneous to directly invoke the ``_c'' specific procedures in the Fortran mpi_f08 module with the exception of the following procedures: MPI_Op_create_c and MPI_Register_datarep_c.

In older Fortran bindings (mpif.h (deprecated) and use mpi), no new interfaces and no new specific procedures for larger types are provided beyond what existed in MPI-3.1; all MPI procedures have the same types as in the versions prior to MPI-4.0.


PreviousUpNext
Up: Language Bindings Next: Language Interoperability Previous: Comparison with C


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