355. Overview

PreviousUpNext
Up: Fortran Support Next: Fortran Support Through the mpi_f08 Module Previous: Fortran Support

The Fortran MPI language bindings have been designed to be compatible with the Fortran 90 standard with additional features from Fortran 2003 and Fortran 2008 [40] + TS 29113 [41].


Rationale. Fortran 90 contains numerous features designed to make it a more ``modern'' language than Fortran 77. It seems natural that MPI should be able to take advantage of these new features with a set of bindings tailored to Fortran 90. In Fortran 2008 + TS 29113, the major new language features used are the ASYNCHRONOUS attribute to protect nonblocking MPI operations, and assumed-type and assumed-rank dummy arguments for choice buffer arguments. Further requirements for compiler support are listed in Section Requirements on Fortran Compilers . ( End of rationale.)
MPI defines three methods of Fortran support:

    1. USE mpi_f08: This method is described in Section Fortran Support Through the mpi_f08 Module . It requires compile-time argument checking with unique MPI handle types and provides techniques to fully solve the optimization problems with nonblocking calls. This is the only Fortran support method that is consistent with the Fortran standard (Fortran 2008 + TS 29113 and later). This method is highly recommended for all MPI applications.
    2. USE mpi: This method is described in Section Fortran Support Through the mpi Module and requires compile-time argument checking. Handles are defined as INTEGER. This Fortran support method is inconsistent with the Fortran standard, and its use is therefore not recommended. It exists only for backwards compatibility.
    3. INCLUDE 'mpif.h': This method is described in Section Fortran Support Through the mpif.h Include File . The use of the include file mpif.h is strongly discouraged starting with MPI-3.0, because this method neither guarantees compile-time argument checking nor provides sufficient techniques to solve the optimization problems with nonblocking calls, and is therefore inconsistent with the Fortran standard. It exists only for backwards compatibility with legacy MPI applications.
Compliant MPI-3 implementations providing a Fortran interface must provide one or both of the following:
Section MPI for Different Fortran Standard Versions describes restrictions if the compiler does not support all the needed features.

Application subroutines and functions may use either one of the modules or the mpif.h include file. An implementation may require the use of one of the modules to prevent type mismatch errors.
Advice to users.

Users are advised to utilize one of the MPI modules even if mpif.h enforces type checking on a particular system. Using a module provides several potential advantages over using an include file; the mpi_f08 module offers the most robust and complete Fortran support. ( End of advice to users.)
In a single application, it must be possible to link together routines which USE mpi_f08, USE mpi, and INCLUDE 'mpif.h'.

The LOGICAL compile-time constant MPI_SUBARRAYS_SUPPORTED is set to .TRUE. if all buffer choice arguments are defined in explicit interfaces with assumed-type and assumed-rank [41]; otherwise it is set to .FALSE.. The LOGICAL compile-time constant MPI_ASYNC_PROTECTS_NONBLOCKING is set to .TRUE. if the ASYNCHRONOUS attribute was added to the choice buffer arguments of all nonblocking interfaces and the underlying Fortran compiler supports the ASYNCHRONOUS attribute for MPI communication (as part of TS 29113), otherwise it is set to .FALSE.. These constants exist for each Fortran support method, but not in the C header file. The values may be different for each Fortran support method. All other constants and the integer values of handles must be the same for each Fortran support method.

Section Fortran Support Through the mpi_f08 Module through Fortran Support Through the mpif.h Include File define the Fortran support methods. The Fortran interfaces of each MPI routine are shorthands. Section Interface Specifications, Procedure Names, and the Profiling Interface defines the corresponding full interface specification together with the specific procedure names and implications for the profiling interface. Section MPI for Different Fortran Standard Versions the implementation of the MPI routines for different versions of the Fortran standard. Section Requirements on Fortran Compilers summarizes major requirements for valid MPI-3.0 implementations with Fortran support. Section Additional Support for Fortran Register-Memory-Synchronization and Section Additional Support for Fortran Numeric Intrinsic Types describe additional functionality that is part of the Fortran support. MPI_F_SYNC_REG is needed for one of the methods to prevent register optimization problems. A set of functions provides additional support for Fortran intrinsic numeric types, including parameterized types: MPI_SIZEOF, MPI_TYPE_MATCH_SIZE, MPI_TYPE_CREATE_F90_INTEGER, MPI_TYPE_CREATE_F90_REAL and MPI_TYPE_CREATE_F90_COMPLEX. In the context of MPI, parameterizedtypes are Fortran intrinsic types which are specified using KIND type parameters. Sections Problems With Fortran Bindings for MPI through Permanent Data Movement give an overview and details on known problems when using Fortran together with MPI; Section Comparison with C compares the Fortran problems with those in C.


PreviousUpNext
Up: Fortran Support Next: Fortran Support Through the mpi_f08 Module Previous: Fortran Support


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

(Unofficial) MPI-3.1 of June 4, 2015
HTML Generated on June 4, 2015