Skip to content

Fortran errata: Clarify where TYPE(MPI_Status) type must be defined #298

@jsquyres

Description

@jsquyres

Problem

The all-caps Fortran binding listed in MPI-3.1 p658 for MPI_Status_f2f08() and MPI_Status_f082f() imply that the Fortran type TYPE(MPI_Status) must be available in both the mpi module and mpif.h.

Upon discussion in the Fortran WG, and supported by other text in the standard, it was decided that the intent was actually to:

  1. Only define those all-caps functions in the mpi module (not in the mpif.h header file)
  2. And therefore only make TYPE(MPI_Status) be available in the mpi module (not in the mpif.h header file).

This problem exists in both MPI-3.x and MPI-4.x (we will need 2 PRs).

Proposal

This errata adds clarification:

  • Adds a text line that specifically states that the MPI_Status_f2f08() and MPI_Status_f082f() routines are only available in Fortran via the mpi and mpi_f08 modules.
  • Adds annotation to the all-caps Fortran bindings indicating that it is only intended for the mpi module.
  • Adds an equivalent annotation in the Annex where these bindings are listed.

Impact on Implementations

Implementations can remove the MPI_Status_f*08* routines and the declaration for TYPE(MPI_Status) from mpif.h.

In reality, neither current versions of Open MPI nor MPICH actually define TYPE(MPI_Status) in mpif.h or the mpi module. 😲 This issue came up when Open MPI discovered their oversight and was discussing how to implement the missing functions (see open-mpi/ompi#7762).

Impact on Users

Joy and good fortune to all who can now easily understand from which interfaces these functions are available.

References

See discussions on the MPI Fortran WG mailing list here: https://lists.mpi-forum.org/pipermail/mpiwg-fortran/2020-July/003554.html.

Summary (from Rolf R.):

In MPI-3.1:

  • page 607 lines 18-24 require these types and the overloaded operators .EQ./.NE. for mpi_f08 module
  • page 609 lines 34-36 require these types and the overloaded operators .EQ./.NE. for mpi module
  • there is no such text on page 611-612 on mpif.h

And page 802 lines 9-15 also Show that it was never intented to add these types and routines to old mpif.h.

Metadata

Metadata

Assignees

No one assigned

    Labels

    chap-bindingsLanguage Bindings Chapter CommitteeerrataErrata items for the previous MPI Standardpassed final votePassed the final formal votewg-fortranFortran Working Group

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions