5.1. Open MPI profiling interface — Open MPI 5.0.8 documentation

# 5.1. Open MPI profiling interface

Open MPI v5.0.8 supportings the “PMPI” profiling interface as perscribed by the MPI standard for the C and Fortran bindings (not the Open MPI Java binding extensions).

Per MPI-4.0 section 15.2.1, MPI implementations must document which bindings layer on top of each other, so that profile developers know whether to implement the profiling interface for each binding, or whether they can economize by implementing it only for the lowest level routines.

In general, Open MPI’s Fortran bindings are implemented on top of the C bindings. Hence, a profile developer who implements `MPI_Init()` in C will also intecept all Fortran calls to `MPI_INIT` regardless of whether the user is utilizing the `mpif.h`, `use mpi`, or `use mpi_f08` Fortran interfaces.

However, there are a handful of routines where Open MPI’s Fortran bindings are not a simple wrapper around the back-end C MPI binding. Profile developers must therefore intercept the APIs listed below in their source language interface bindings in order to receive full profiling coverage. Note, however, that it is only necessary for profile developers to intercept the `mpif.h` binding of each of the routines listed below; the `use mpi` and `use mpi_f08` bindings will ultimately invoke the `mpif.h` binding.

- APIs that contain function pointer parameters:

  Rationale

  In order for Open MPI to invoke callbacks through the function pointer with the proper language-specific calling conventions, it must know the source language from which the function pointer was passed.

  - MPI_Comm_create_keyval

  - MPI_Comm_create_errhandler

  - MPI_Errhandler_create

    Warning

    This function was deprecated by MPI-3.0.

  - MPI_File_create_errhandler

  - MPI_Grequest_start

  - MPI_Keyval_create

    Warning

    This function was deprecated by MPI-3.0.

  - MPI_Op_create

  - MPI_Register_datarep

  - MPI_Session_create_errhandler

  - MPI_Type_create_keyval

  - MPI_Win_create_keyval

  - MPI_Win_create_errhandler

- APIs dealing with MPI attributes:

  Rationale

  The MPI standard’s treatment of attributes differs depending on which language / interface was used to create the attribute keyval, get the attribute value, or set the attribute value.

  - MPI_Comm_get_attr

  - MPI_Comm_set_attr

  - MPI_Type_get_attr

  - MPI_Type_set_attr

  - MPI_Win_get_attr

  - MPI_Win_set_attr

Note that there is no harm in intercepting all routines in all interfaces. Indeed, that is the most portable way to implement a profiling interface. Since Open MPI’s Fortran bindings are — for the most part — implemented on top of its C bindings, profile developers can ignore all Fortran interfaces except for the ones enumated above.