Skip to content

Commit

Permalink
docs: update list of deprecated/removed functions.
Browse files Browse the repository at this point in the history
This commit address issue open-mpi#10099

Update documentation with the list of depreacted functions in MPI 2.2
and MPI-4.0. Add some examples and explanation on how to convert
code from the deprecated interfaces to the new ones.

Add a new section on ABI compatibility to Open MPI 4.1

Signed-off-by: Edgar Gabriel <[email protected]>
  • Loading branch information
edgargabriel committed Jul 14, 2023
1 parent 7b87ae4 commit ee20cf8
Show file tree
Hide file tree
Showing 9 changed files with 295 additions and 41 deletions.
2 changes: 1 addition & 1 deletion 3rd-party/openpmix
Submodule openpmix updated 140 files
2 changes: 1 addition & 1 deletion 3rd-party/prrte
Submodule prrte updated 80 files
+1 −1 .github/workflows/pr-target.yaml
+1 −1 .github/workflows/run-special.yml
+1 −2 .gitignore
+0 −19 .readthedocs.yaml
+0 −1 LICENSE
+4 −27 autogen.pl
+1 −1 config/oac
+1 −0 config/prte_config_files.m4
+5 −5 config/prte_setup_pmix.m4
+2 −25 examples/client.c
+2 −2 examples/dmodex.c
+1 −6 examples/fault.c
+3 −3 src/Makefile.am
+2 −2 src/event/event-internal.h
+0 −8 src/hwloc/hwloc-internal.h
+4 −59 src/hwloc/hwloc.c
+4 −162 src/hwloc/hwloc_base_util.c
+23 −22 src/include/Makefile.am
+0 −4 src/include/prte_stdatomic.h
+1 −7 src/mca/errmgr/dvm/errmgr_dvm.c
+16 −24 src/mca/errmgr/prted/errmgr_prted.c
+3 −17 src/mca/ess/base/ess_base_std_prted.c
+2 −4 src/mca/ess/hnp/ess_hnp_module.c
+3 −3 src/mca/filem/raw/filem_raw_module.c
+3 −11 src/mca/grpcomm/base/grpcomm_base_frame.c
+3 −52 src/mca/grpcomm/direct/grpcomm_direct.c
+0 −5 src/mca/grpcomm/grpcomm.h
+3 −4 src/mca/odls/base/odls_base_default_fns.c
+2 −2 src/mca/oob/base/base.h
+0 −9 src/mca/oob/tcp/oob_tcp.c
+1 −3 src/mca/oob/tcp/oob_tcp_component.h
+2 −2 src/mca/oob/tcp/oob_tcp_connection.h
+2 −2 src/mca/oob/tcp/oob_tcp_peer.h
+5 −5 src/mca/oob/tcp/oob_tcp_sendrecv.h
+20 −20 src/mca/plm/base/plm_base_launch_support.c
+4 −4 src/mca/plm/base/plm_base_receive.c
+0 −5 src/mca/ras/base/ras_base_allocate.c
+1 −4 src/mca/rmaps/base/base.h
+12 −15 src/mca/rmaps/base/rmaps_base_binding.c
+122 −188 src/mca/rmaps/base/rmaps_base_frame.c
+16 −164 src/mca/rmaps/base/rmaps_base_map_job.c
+72 −28 src/mca/rmaps/ppr/rmaps_ppr.c
+0 −2 src/mca/rmaps/rmaps_types.h
+30 −0 src/mca/rmaps/round_robin/rmaps_rr.c
+39 −41 src/mca/rmaps/round_robin/rmaps_rr_mappers.c
+1 −2 src/mca/schizo/base/base.h
+4 −12 src/mca/schizo/base/help-schizo-base.txt
+0 −18 src/mca/schizo/base/schizo_base_frame.c
+96 −250 src/mca/schizo/base/schizo_base_stubs.c
+148 −2 src/mca/schizo/ompi/schizo_ompi.c
+146 −2 src/mca/schizo/prte/schizo_prte.c
+12 −11 src/mca/state/base/state_base_fns.c
+13 −12 src/mca/state/prted/state_prted.c
+34 −59 src/prted/pmix/pmix_server.c
+20 −25 src/prted/pmix/pmix_server_dyn.c
+0 −6 src/prted/pmix/pmix_server_fence.c
+68 −129 src/prted/pmix/pmix_server_gen.c
+1 −2 src/prted/pmix/pmix_server_internal.h
+121 −200 src/prted/pmix/pmix_server_queries.c
+0 −11 src/prted/pmix/pmix_server_register_fns.c
+0 −58 src/prted/pmix/pmix_server_session.c
+4 −17 src/prted/prte_app_parse.c
+5 −9 src/rml/rml.c
+3 −3 src/rml/rml_recv.c
+1 −7 src/rml/routed_radix.c
+58 −176 src/runtime/data_type_support/prte_dt_print_fns.c
+30 −30 src/runtime/prte_init.c
+2 −2 src/runtime/prte_wait.c
+1 −2 src/runtime/runtime.h
+7 −13 src/tools/prte/prte.c
+4 −1 src/tools/prte_info/Makefile.am
+2 −2 src/tools/prte_info/components.c
+6 −1 src/tools/prte_info/param.c
+9 −17 src/tools/prte_info/prte_info.c
+3 −7 src/tools/prte_info/version.c
+6 −21 src/tools/prted/prted.c
+1 −6 src/tools/prun/prun.c
+7 −15 src/tools/pterm/pterm.c
+14 −16 src/util/attr.h
+1 −3 src/util/nidmap.c
2 changes: 1 addition & 1 deletion config/oac
19 changes: 19 additions & 0 deletions docs/building-apps/abi-compatibility.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. -label-binary-compatibility:
ABI compatibility to previous versions of Open MPI
==================================================

Open MPI v5.0 intends to maintain Application Binary Interface (ABI)
compatibility to the last major Open MPI release. Technically, an
application compiled with Open MPI 4.1 can be executed with Open MPI
5.0 without having to recompile the application.

There are however a few scenarios where an application compiled with
Open MPI 4.1 might not execute correctly with Open MPI 5.0.

- There were some minor changes in the Fortran Interfaces (Jeff, need
your help what to say here).

- Open MPI 5.0 removed support for the C++ bindings. If an application
was using the deprecated and now removed C++ bindings, it will not
be able to execute with Open MPI 5.0, for details on deprecated and removed functions see :ref:`Removed MPI constructs <label-removed-mpi-constructs>` and :ref: `Deprecation warnings <label-deprecated-functions>`
246 changes: 234 additions & 12 deletions docs/building-apps/deprecation-warnings.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.. _label-deprecated-functions:

Deprecation warnings while compiling MPI applications
=====================================================

If you see deprecation warnings when compiling MPI applications, it is
because your application is symbols / functions that are deprecated in
MPI. For example:
MPI. For example:

.. code-block:: sh
Expand All @@ -25,16 +27,236 @@ advises you to use ``MPI_Comm_delete_attr()`` instead of
Also, note that even if Open MPI was configured with
``--enable-mpi1-compatibility`` to re-enable removed MPI-1 symbols,
you will still get compiler warnings when you use the removed symbols.
For example:

.. code-block:: sh
The following is a list of functions that have been deprecated in MPI,
and the function that is replacing them. Some functions have been
deprecated and removed from the MPI specification, these functions are
listed :ref:`here <label-removed-mpi-constructs>`.

.. list-table::
:header-rows: 1

* - Deprecated symbol

(click for more details, below)
- Replaced with

(click to go to the corresponding man page)
- MPI version deprecating the symbol

* - :ref:`MPI_KEYVAL_CREATE <label-mpi-keyval-create>`
- :ref:`MPI_COMM_CREATE_KEYVAL <mpi_comm_create_keyval>`
- MPI-2.0 (1996)

* - :ref:`MPI_KEYVAL_FREE <label-mpi-keyval-free>`
- :ref:`MPI_COMM_FREE_KEYVAL <mpi_comm_free_keyval>`
- MPI-2.0 (1996)

* - :ref:`MPI_COPY_FUNCTION <label-mpi-copy-delete-function>`
- :ref:`MPI_COMM_COPY_ATTR_FUNCTION <mpi_comm_create_keyval>`
- MPI-2.0 (1996)

* - :ref:`MPI_DELETE_FUNCTION <label-mpi-copy-delete-function>`
- :ref:`MPI_COMM_DELETE_ATTR_FUNCTION <mpi_comm_create_keyval>`
- MPI-2.0 (1996)

* - :ref:`MPI_ATTR_PUT <label-mpi-attr-put>`
- :ref:`MPI_COMM_SET_ATTR <mpi_comm_set_attr>`
- MPI-2.0 (1996)

* - :ref:`MPI_ATTR_GET <label-mpi-attr-get>`
- :ref:`MPI_COMM_GET_ATTR <mpi_comm_get_attr>`
- MPI-2.0 (1996)

* - :ref:`MPI_ATTR_DELETE <label-mpi-attr-delete>`
- :ref:`MPI_COMM_DELETE_ATTR <mpi_comm_delete_attr>`
- MPI-2.0 (1996)

* - :ref:`MPI_Comm_errhandler_fn <label-errhandler-fn>`
- :ref:`MPI_Comm_errhandler_function <mpi_comm_create_errhandler>`
- MPI-2.2 (2009)

* - :ref:`MPI_File_errhandler_fn <label-errhandler-fn>`
- :ref:`MPI_File_errhandler_function <mpi_file_create_errhandler>`
- MPI-2.2 (2009)

* - :ref:`MPI_Win_errhandler_fn <label-errhandler-fn>`
- :ref:`MPI_Win_errhandler_function <mpi_win_create_errhandler>`
- MPI-2.2 (2009)

* - :ref:`MPI_INFO_GET <label-mpi-info-get>`
- :ref:`MPI_INFO_GET_STRING <mpi_info_get_string>`
- MPI-4.0 (2021)

* - :ref:`MPI_INFO_GET_VALUELEN <label-mpi-info-get-valuelen>`
- :ref:`MPI_INFO_GET_STRING <mpi_info_get_string>`
- MPI-4.0 (2021)

* - :ref:`MPI_SIZEOF <label-mpi-sizeof>`
- `c_sizeof` or `storage_size`
- MPI-4.0 (2021)

.. _label-mpi-keyval-create:

MPI_Keyval_create
-----------------

`MPI_Keyval_create` has been deprecated and replaced by
`MPI_Comm_create_keyval`. The C binding of the new function is
identical to the deprecated version. Hence, applications can simply
replace the function that is being invoked.

The Fortran binding differs in that the `extra_state` argument is an
address-sized integer in the new interfaces (vs. a regular integer in
the old interfaces). Also, the copy and delete callback functions have
Fortran bindings that are consistent with address-sized attributes.

.. code-block:: Fortran
USE mpi
EXTERNAL my_copy_attr_function
EXTERNAL my_copy_delete_function
INTEGER ierror
INTEGER comm_keyval
INTEGER old_extra_state
INTEGER(KIND=MPI_ADDRESS_KIND) new_extra_state
! Old way
CALL MPI_KEYVAL_CREATE(my_copy_attr_function, my_copy_delete_function,
comm_keyval, old_extra_state, ierror)
! New way
CALL MPI_COMM_CREATE_KEYVAL(my_copy_attr_function, my_delete_attr_function,
comm_keyval, new_extra_state, ierror)
.. _label-mpi-keyval-free:

MPI_Keyval_free
----------------

The binding of ``MPI_Keyval_free`` and ``MPI_Comm_free_keyval`` are identical
for both C and Fortran. Users can directly replace the depracted function with its
new version.

.. _label-mpi-copy-delete-function:

MPI_Copy_function and MPI_Delete_function
------------------------------------------

The ``MPI_Copy_function`` and ``MPI_Delete_function`` are only used in the
deprecated function ``MPI_Keyval_create()``, as described in the
:ref:`MPI_COMM_CREATE_KEYVAL <label-mpi-keyval-create>`.

For C codes, developers can simply use the new, exactly-equivalent
type name (i.e., the return type, number, and type of parameters
didn't change) ``MPI_Comm_copy_attr_function``, and
``MPI_Comm_delete_attr_function`` respectively.

For Fortran applications, the only difference lies in required integer type for the
``extra_state`` argument, which now has to be an address-sized integer.

.. _label-mpi-attr-put:

MPI_Attr_put
------------

C bindings are identical. Fortran binding differ in the usage of an
addressed size integer for the attribute value in the new
``MPI_Comm_set_attr`` vs. a regular integer in ``MPI_Attr_put``.

.. code-block:: Fortran
USE mpi
INTEGER ierror
INTEGER comm_keyval
INTEGER old_attr_val
INTEGER(KIND=MPI_ADDRESS_KIND) new_attr_val
! Old way
CALL MPI_ATTR_PUT(MPI_COMM_WORLD, comm_keyval,
old_attr_val, ierror)
! New way
CALL MPI_COMM_SET_ATTR(MPI_COMM_WORLD, comm_keyval,
new_attr_val, ierror)
.. _label-mpi-attr-get:

MPI_Attr_get
------------

The C bindings of the old and the new interfaces are identical.
Fortran binding differ in the usage of an addressed size integer for
the attribute value in the new ``MPI_Comm_get_attr`` vs. a regular
integer in ``MPI_Attr_get``.

.. _label-mpi-attr-delete:

MPI_Attr_delete
---------------

C and Fortran bindings are identical for ``MPI_Attr_delete`` and
``MPI_Comm_delete_attr``, hence developers should be able to just
directly substitute one function call by the other.


.. _label-mpi-info-get:

MPI_Info_get
------------

.. code-block:: c++

MPI_Info info;

// Create an info object using MPI_Info_create()
...

// Retrieve the the value of a provided key later in the code
char key[] = "my_key";
char value[64];
int valuelen=64;
int flag;

// Old way
MPI_Info_get(info, key, valuelen, &value, &flag);

// New way
// Note that we pass the address of valuelen with
// the new interfaces, since the variable will
// contain the length of the value string after
// the function call.
MPI_Info_get_string(info, key, &valuelen, &value, &flag);
}

.. _label-mpi-info-get-valuelen:

MPI_Info_get_valuelen
---------------------

`MPI_Info_get_valuelen` has been deprecated since the new function
`MPI_Info_get_string` also returns the length of the value string.
Please refer to the example shown in :ref:`MPI_INFO_GET <label-mpi-info-get>`.

.. _label-mpi-sizeof:

MPI_Sizeof
----------

The `MPI_SIZEOF` construct in Fortran has been deprected since there
are standard Fortran language constructs such as `c_sizeof` and
`storage_size` that can be used instead.

.. _label-errhandler-fn:

MPI_Comm_errhandler_fn, MPI_File_errhandler_fn, MPI_Win_errhandler_fn
---------------------------------------------------------------------

The following function typedefs have been deprecated and are superseded by new
names. Other than the typedef names, the function signatures are exactly the same; the
names were updated to match conventions of other function typedef names.

shell$ mpicc deleted-example.c -c
deleted-example.c: In function 'foo':
deleted-example.c:8:5: warning: 'MPI_Address' is deprecated: MPI_Address was removed in MPI-3.0; use MPI_Get_address instead. [-Wdeleted-declarations]
MPI_Address(buffer, &address);
^~~~~~~~~~~
In file included from deleted-example.c:2:
/usr/local/openmpi/include/mpi.h:2689:20: note: declared here
OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address)
^~~~~~~~~~~
* ``MPI_Comm_errhandler_fn`` |rarrow| ``MPI_Comm_errhandler_function``
* ``MPI_File_errhandler_fn`` |rarrow| ``MPI_File_errhandler_function``
* ``MPI_Win_errhandler_fn`` |rarrow| ``MPI_Win_errhandler_function``
1 change: 1 addition & 0 deletions docs/building-apps/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Open MPI "wrapper" compilers.
quickstart
customizing-wrappers
extracting-wrapper-flags
abi-compatibility
removed-mpi-constructs
deprecation-warnings
building-static-apps
Expand Down
50 changes: 27 additions & 23 deletions docs/building-apps/removed-mpi-constructs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
Removed MPI constructs
======================

.. error:: **TODO This section needs to be renamed/updated for the
5.0.0 behavior.**

Starting with v4.0.0, Open MPI |mdash| by default |mdash| removes the
prototypes from ``mpi.h`` for MPI symbols that were deprecated in 1996
in the MPI-2.0 standard, and finally removed from the MPI-3.0 standard
Expand Down Expand Up @@ -110,18 +107,23 @@ default:
- MPI-3.0 (2012)

Although these symbols are no longer prototyped in ``mpi.h``, *they are
still present in the MPI library in Open MPI v4.0.x*. This enables
still present in the MPI library in Open MPI |ompi_ver|. This enables
legacy MPI applications to *link and run* successfully with Open MPI
v4.0.x, even though they will fail to *compile*.
|ompi_ver|, even though they will fail to *compile*.

Furthermore, the C++ interfaces of MPI have been deprecated in version
2.2 of the specification and have bee removed in MPI-3.0. Starting
from v5.0 Open MPI will not have support for the C++ interfaces
anymore. Users that would like to continue using the C++ interfaces of
MPI will have to revert to an older release of Open MPI.

.. warning:: The Open MPI team **strongly** encourages all
MPI application developers to stop using these constructs that were
first deprecated over 20 years ago, and finally removed from the MPI
specification in MPI-3.0 (in 2012).

The FAQ items in this category
show how to update your application to stop using these removed
symbols.
The FAQ items in this category show how to update your application to
stop using these removed symbols.

All that being said, if you are unable to immediately update your
application to stop using these removed MPI-1 symbols, you can
Expand All @@ -131,22 +133,24 @@ re-enable them in ``mpi.h`` by configuring Open MPI with the
.. note:: Future releases of Open MPI may remove these symbols
altogether.

Why on earth are you breaking the compilation of MPI applications?
Why is Open MPI breaking the compilation of MPI applications?
------------------------------------------------------------------

.. error:: **TODO This section needs to be renamed/updated (or
deleted?) for the 5.0.0 behavior.**

The Open MPI developer community decided to take a first step of
removing the prototypes for these symbols from ``mpi.h`` starting with
the Open MPI v4.0.x series for the following reasons:

#. These symbols have been deprecated since *1996.* It's time to start
raising awareness for developers who are inadvertently still using
these removed symbols.
#. The MPI Forum removed these symbols from the MPI-3.0 specification
in 2012. This is a sign that the Forum itself recognizes that
these removed symbols are no longer needed.
removing prototypes of deprecated functions from ``mpi.h`` starting
with the Open MPI v4.0.x series for the following reasons:

#. The first set of symbols have been deprecated since *1996.* It's
time to start raising awareness for developers who are
inadvertently still using these removed symbols.
#. The MPI Forum removed a substantial set of symbols from the MPI-3.0
specification in 2012. This is a sign that the Forum itself
recognizes that these removed symbols are no longer needed.
#. More functions have been deprecated in MPI 2.2 and MPI 4.0, and
additional functions are expected to be deprecated and removed in
future MPI versions. It is in the interest of both, developers and
end-users, to minimize confusion as much as possible, and stick
closely to the MPI specification.
#. Note that Open MPI *did not fully remove* these removed symbols: we
just made it slightly more painful to get to them. This is an
attempt to raise awareness so that MPI application developers can
Expand Down Expand Up @@ -189,7 +193,7 @@ to change:
MPI_Get_address(buffer, &address);

In Fortran, the type of the parameter changed from ``INTEGER``
$right_arrow ``INTEGER(KIND=MPI_ADDRESS_KIND)`` so that it can hold
|rarrow| ``INTEGER(KIND=MPI_ADDRESS_KIND)`` so that it can hold
larger values (e.g., 64 bit pointers):

.. code-block:: Fortran
Expand Down Expand Up @@ -251,7 +255,7 @@ In Fortran, only the subroutine name changed:
! Old way
CALL MPI_ERRHANDLER_CREATE(my_errhandler_function, my_handler, ierror)
! Old way
! New way
CALL MPI_COMM_CREATE_ERRHANDLER(my_errhandler_function, my_handler, ierror)
.. _label-mpi-errhandler-get:
Expand Down
Loading

0 comments on commit ee20cf8

Please sign in to comment.