Skip to content

Commit c2a3016

Browse files
authored
Merge pull request #10450 from jsquyres/pr/document-the-profiling-interface
docs: describe the MPI profiling interface
2 parents e78897b + db8774a commit c2a3016

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

docs/features/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ categories of Open MPI-specific features.
1111
.. toctree::
1212
:maxdepth: 1
1313

14+
profiling
1415
extensions
1516
ulfm
1617
java

docs/features/profiling.rst

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.. _open-mpi-profileing-label:
2+
3+
Open MPI profiling interface
4+
============================
5+
6+
Open MPI |ompi_ver| supportings the "PMPI" profiling interface as
7+
perscribed by the MPI standard for the C and Fortran bindings (*not*
8+
the :ref:`Open MPI Java binding extensions <open-mpi-java-label>`).
9+
10+
Per MPI-4.0 section 15.2.1, MPI implementations must document which
11+
bindings layer on top of each other, so that profile developers know
12+
whether to implement the profiling interface for each binding, or
13+
whether they can economize by implementing it only for the lowest
14+
level routines.
15+
16+
In general, Open MPI's Fortran bindings are implemented on top of the
17+
C bindings. Hence, a profile developer who implements ``MPI_Init()``
18+
in C will also intecept all Fortran calls to ``MPI_INIT`` regardless
19+
of whether the user is utilizing the ``mpif.h``, ``use mpi``, or ``use
20+
mpi_f08`` Fortran interfaces.
21+
22+
However, there are a handful of routines where Open MPI's Fortran
23+
bindings are *not* a simple wrapper around the back-end C MPI binding.
24+
Profile developers must therefore intercept the APIs listed below in
25+
their source language interface bindings in order to receive full
26+
profiling coverage. Note, however, that it is only necessary for
27+
profile developers to intercept the ``mpif.h`` binding of each of the
28+
routines listed below; the ``use mpi`` and ``use mpi_f08`` bindings
29+
will ultimately invoke the ``mpif.h`` binding.
30+
31+
* APIs that contain function pointer parameters:
32+
33+
.. admonition:: Rationale
34+
:class: Hint
35+
36+
In order for Open MPI to invoke callbacks through the function
37+
pointer with the proper language-specific calling conventions, it
38+
must know the source language from which the function pointer was
39+
passed.
40+
41+
* :ref:`MPI_COMM_CREATE_KEYVAL`
42+
* :ref:`MPI_COMM_CREATE_ERRHANDLER`
43+
* :ref:`MPI_ERRHANDLER_CREATE`
44+
45+
.. warning:: This function was deprecated by MPI-3.0.
46+
47+
* :ref:`MPI_FILE_CREATE_ERRHANDLER`
48+
* :ref:`MPI_GREQUEST_START`
49+
* :ref:`MPI_KEYVAL_CREATE`
50+
51+
.. warning:: This function was deprecated by MPI-3.0.
52+
53+
* :ref:`MPI_OP_CREATE`
54+
* :ref:`MPI_REGISTER_DATAREP`
55+
* :ref:`MPI_SESSION_CREATE_ERRHANDLER`
56+
* :ref:`MPI_TYPE_CREATE_KEYVAL`
57+
* :ref:`MPI_WIN_CREATE_KEYVAL`
58+
* :ref:`MPI_WIN_CREATE_ERRHANDLER`
59+
60+
* APIs dealing with MPI attributes:
61+
62+
.. admonition:: Rationale
63+
:class: Hint
64+
65+
The MPI standard's treatment of attributes differs depending on
66+
which language / interface was used to create the attribute
67+
keyval, get the attribute value, or set the attribute value.
68+
69+
* :ref:`MPI_COMM_GET_ATTR`
70+
* :ref:`MPI_COMM_SET_ATTR`
71+
* :ref:`MPI_TYPE_GET_ATTR`
72+
* :ref:`MPI_TYPE_SET_ATTR`
73+
* :ref:`MPI_WIN_GET_ATTR`
74+
* :ref:`MPI_WIN_SET_ATTR`
75+
76+
Note that there is no harm in intercepting *all* routines in *all*
77+
interfaces. Indeed, that is the most portable way to implement a
78+
profiling interface. Since Open MPI's Fortran bindings are |mdash|
79+
for the most part |mdash| implemented on top of its C bindings,
80+
profile developers can ignore all Fortran interfaces except for the
81+
ones enumated above.

0 commit comments

Comments
 (0)