Skip to content

MPI_T: provide a stub implementation of events #13086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ AC_MSG_CHECKING([for bootstrap Libtool version])
ltversion=`grep VERSION= $srcdir/config/ltmain.sh | head -n 1 | cut -d= -f2`
AC_MSG_RESULT([$ltversion])

# Ensure mpi.h.in and mca_base_event.h have consistent callback safety values
AC_DEFINE_UNQUOTED([OPAL_MCA_BASE_CB_REQUIRE_NONE], [0], [Keeping OPAL and OMPI values in sync])
AC_DEFINE_UNQUOTED([OPAL_MCA_BASE_CB_REQUIRE_MPI_RESTRICTED], [1], [Keeping OPAL and OMPI values in sync])
AC_DEFINE_UNQUOTED([OPAL_MCA_BASE_CB_REQUIRE_THREAD_SAFE], [2], [Keeping OPAL and OMPI values in sync])
AC_DEFINE_UNQUOTED([OPAL_MCA_BASE_CB_REQUIRE_ASYNC_SIGNAL_SAFE], [3], [Keeping OPAL and OMPI values in sync])

# List header files to generate

AC_CONFIG_HEADERS([opal/include/opal_config.h])
Expand Down Expand Up @@ -1399,6 +1405,7 @@ if test $ac_cv_header_sys_synch_h = yes ; then
[Do not use outside of mpi.h. Define to 1 if you have the <sys/synch.h> header file.])
fi


# If there is a local hook for each project, call it. This allows 3rd
# parties to add configuration steps to OPAL and/or OMPI simply
# by placing a file in [opal|ompi]/config/whatever.m4 that
Expand Down
18 changes: 18 additions & 0 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,21 @@ OMPI_MAN3 = \
MPI_T_cvar_write.3 \
MPI_T_enum_get_info.3 \
MPI_T_enum_get_item.3 \
MPI_T_event_callback_get_info.3 \
MPI_T_event_callback_set_info.3 \
MPI_T_event_copy.3 \
MPI_T_event_get_index.3 \
MPI_T_event_get_info.3 \
MPI_T_event_get_num.3 \
MPI_T_event_get_source.3 \
MPI_T_event_get_timestamp.3 \
MPI_T_event_handle_alloc.3 \
MPI_T_event_handle_free.3 \
MPI_T_event_handle_get_info.3 \
MPI_T_event_handle_set_info.3 \
MPI_T_event_read.3 \
MPI_T_event_register_callback.3 \
MPI_T_event_set_dropped_handler.3 \
MPI_Test.3 \
MPI_Testall.3 \
MPI_Testany.3 \
Expand All @@ -457,6 +472,9 @@ OMPI_MAN3 = \
MPI_T_pvar_start.3 \
MPI_T_pvar_stop.3 \
MPI_T_pvar_write.3 \
MPI_T_source_get_info.3 \
MPI_T_source_get_num.3 \
MPI_T_source_get_timestamp.3 \
MPI_Type_c2f.3 \
MPI_Type_commit.3 \
MPI_Type_contiguous.3 \
Expand Down
45 changes: 45 additions & 0 deletions docs/man-openmpi/man3/MPI_T.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,49 @@ Open MPI's MPI_T categories are organized hierarchically:


.. seealso::
* :ref:`MPI_T_category_changed`
* :ref:`MPI_T_category_get_categories`
* :ref:`MPI_T_category_get_cvars`
* :ref:`MPI_T_category_get_info`
* :ref:`MPI_T_category_get_num`
* :ref:`MPI_T_category_get_pvars`
* :ref:`MPI_T_cvar_get_info`
* :ref:`MPI_T_cvar_get_num`
* :ref:`MPI_T_cvar_handle_alloc`
* :ref:`MPI_T_cvar_handle_free`
* :ref:`MPI_T_cvar_read`
* :ref:`MPI_T_cvar_write`
* :ref:`MPI_T_enum_get_info`
* :ref:`MPI_T_enum_get_item`
* :ref:`MPI_T_event_callback_get_info`
* :ref:`MPI_T_event_callback_set_info`
* :ref:`MPI_T_event_copy`
* :ref:`MPI_T_event_get_index`
* :ref:`MPI_T_event_get_info`
* :ref:`MPI_T_event_get_num`
* :ref:`MPI_T_event_get_source`
* :ref:`MPI_T_event_get_timestamp`
* :ref:`MPI_T_event_handle_alloc`
* :ref:`MPI_T_event_handle_free`
* :ref:`MPI_T_event_handle_get_info`
* :ref:`MPI_T_event_handle_set_info`
* :ref:`MPI_T_event_read`
* :ref:`MPI_T_event_register_callback`
* :ref:`MPI_T_event_set_dropped_handler`
* :ref:`MPI_T_finalize`
* :ref:`MPI_T_init_thread`
* :ref:`MPI_T_pvar_get_info`
* :ref:`MPI_T_pvar_get_num`
* :ref:`MPI_T_pvar_handle_alloc`
* :ref:`MPI_T_pvar_handle_free`
* :ref:`MPI_T_pvar_read`
* :ref:`MPI_T_pvar_readreset`
* :ref:`MPI_T_pvar_reset`
* :ref:`MPI_T_pvar_session_create`
* :ref:`MPI_T_pvar_session_free`
* :ref:`MPI_T_pvar_start`
* :ref:`MPI_T_pvar_stop`
* :ref:`MPI_T_pvar_write`
* :ref:`MPI_T_source_get_info`
* :ref:`MPI_T_source_get_num`
* :ref:`MPI_T_source_get_timestamp`
7 changes: 7 additions & 0 deletions docs/man-openmpi/man3/MPI_T_ERRORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* ``MPI_T_ERR_NOT_INITIALIZED``: The MPI Tools interface is not initialized.

* ``MPI_T_ERR_INVALID_HANDLE``: The handle is invalid.

* ``MPI_T_ERR_INVALID_HANDLE``: Invalid use of the interface or bad parameter values(s).

* ``MPI_T_ERR_OTHER``: Other error
49 changes: 49 additions & 0 deletions docs/man-openmpi/man3/MPI_T_event_callback_get_info.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. _mpi_t_event_callback_get_info:


MPI_T_event_callback_get_info
=============================

.. include_body

:ref:`MPI_T_event_callback_get_info` |mdash| Returns a new info object containing the hints of the callback function registered for the callback safety level specified by cb_safety of the event-registration handle associated with event_registration.

SYNTAX
------


C Syntax
^^^^^^^^

.. code-block:: c

#include <mpi.h>

int MPI_T_event_callback_get_info(MPI_T_event_registration event_registration,
MPI_T_cb_safety cb_safety, MPI_Info *info_used)


INPUT PARAMETERS
----------------
* ``event_registration``: Event registration
* ``cb_safety``: maximum callback safety level

OUTPUT PARAMETERS
-----------------

* ``info_used``: Info argument

DESCRIPTION
-----------

:ref:`MPI_T_event_callback_get_info` returns a new info object containing the
hints of the callback function registered for the callback safety level specified by ``cb_safety`` of
the event-registration handle associated with ``event_registration``.


ERRORS
------

:ref:`MPI_T_event_callback_get_info` will fail if:

.. include:: ./MPI_T_ERRORS.rst
43 changes: 43 additions & 0 deletions docs/man-openmpi/man3/MPI_T_event_callback_set_info.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.. _mpi_t_event_callback_set_info:


MPI_T_event_callback_set_info
=============================

.. include_body

:ref:`MPI_T_event_callback_set_info` |mdash| Updates the hints of the callback function registered for the callback safety level specified by cb_safety of the event-registration handle associated with event_registration.

SYNTAX
------


C Syntax
^^^^^^^^

.. code-block:: c

#include <mpi.h>

int MPI_T_event_callback_set_info(MPI_T_event_registration event_registration,
MPI_T_cb_safety cb_safety, MPI_Info info)


INPUT PARAMETERS
----------------
* ``event_registration``: Event registration
* ``cb_safety``: maximum callback safety level
* ``info``: Info argument

DESCRIPTION
-----------

:ref:`MPI_T_event_callback_set_info` Updates the hints of the callback function registered for the callback safety level specified by ``cb_safety`` of the event-registration handle associated with event_registration.


ERRORS
------

:ref:`MPI_T_event_callback_set_info` will fail if:

.. include:: ./MPI_T_ERRORS.rst
47 changes: 47 additions & 0 deletions docs/man-openmpi/man3/MPI_T_event_copy.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _mpi_t_event_copy:


MPI_T_event_copy
================

.. include_body

:ref:`MPI_T_event_copy` |mdash| Copy event data as a whole into a user-specified buffer.


SYNTAX
------


C Syntax
^^^^^^^^

.. code-block:: c

#include <mpi.h>

int MPI_T_event_copy(MPI_T_event_instance event_instance, void *buffer)


INPUT PARAMETERS
----------------
* ``event_instance``: event-instance handle provided to the callback function.
* ``buf``: pointer to a memory location to store the event data.

DESCRIPTION
-----------

:ref:`MPI_T_event_copy` copies the event data as a whole into the user-provided buffer.
The user must assure that the buffer is of at least the size of the extent of the event
type, which can be computed from the type and displacement information returned by the
corresponding call to :ref:`MPI_T_event_get_info`.

ERRORS
------

:ref:`MPI_T_event_copy` will fail if:

.. include:: ./MPI_T_ERRORS.rst

.. seealso::
* :ref:`MPI_T_event_read`
52 changes: 52 additions & 0 deletions docs/man-openmpi/man3/MPI_T_event_get_index.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _mpi_t_event_get_index:


MPI_T_event_get_index
=====================

.. include_body

:ref:`MPI_T_event_get_index` |mdash| Query the index of an event type identified by a known event type name


SYNTAX
------


C Syntax
^^^^^^^^

.. code-block:: c

#include <mpi.h>

int MPI_T_event_get_index(const char *name, int *event_index)


INPUT PARAMETERS
-----------------

* ``name``: name of the event type

OUTPUT PARAMETERS
-----------------

* ``event_index``: index of the event type


DESCRIPTION
-----------

:ref:`MPI_T_event_get_index` can be used to query for the index of an event type identified by a known
event type name.

ERRORS
------

:ref:`MPI_T_event_get_index` will fail if:

* ``MPI_T_ERR_NOT_INITIALIZED``: The MPI Tools interface is not
initialized

* ``MPI_T_ERR_INVALID_NAME``: The event name is invalid
initialized
67 changes: 67 additions & 0 deletions docs/man-openmpi/man3/MPI_T_event_get_info.3.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. _mpi_t_event_get_info:


MPI_T_event_get_info
====================

.. include_body

:ref:`MPI_T_event_get_info` |mdash| Returns additional information about a specific event type


SYNTAX
------


C Syntax
^^^^^^^^

.. code-block:: c

#include <mpi.h>

int MPI_T_event_get_info(int event_index, char *name, int *name_len,
int *verbosity, MPI_Datatype array_of_datatypes[],
MPI_Aint array_of_displacements[], int *num_elements,
MPI_T_enum *enumtype, MPI_Info *info, char *desc,
int *desc_len, int *bind)

INPUT PARAMETERS
----------------
* ``event_index``: Index of the event to be queried.

INPUT/OUTPUT PARAMETERS
-----------------------
* ``name_len``: Length of the string and/or buffer for name.
* ``desc_len``: Length of the string and/or buffer for desc.
* ``num_elements``: length of array of datatypes and displacements.

OUTPUT PARAMETERS
-----------------
* ``name``: Buffer to return the string containing the name of the event type.
* ``verbosity``: Verbosity level of this event type
* ``array_of_datatypes``: Array of MPI basic datatypes used to encode the event data
* ``array_of_displacements``: Array of byte displacements of the elements in the event buffer
* ``enumtype``: Optional descriptor for enumeration information
* ``info``: Optional info argument.
* ``desc``: Buffer to return the string containing the description of the event type.
* ``bind``: Type of MPI object to which an event of this type must be bound

DESCRIPTION
-----------

:ref:`MPI_T_event_get_info` can be used to query information from for a specific event type.


ERRORS
------

:ref:`MPI_T_event_get_info` will fail if:

* ``MPI_T_ERR_NOT_INITIALIZED``: The MPI Tools interface not initialized

* ``MPI_T_ERR_INVALID_INDEX``: The source index is invalid

* ``MPI_T_ERR_INVALID``: Invalid use of the interface or bad parameter values(s).

* ``MPI_ERR_OTHER``: Other error
Loading