Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
defea5f
bugfix: Setting OMPI_MPI_THREAD_LEVEL to a value different than
abouteiller Apr 25, 2025
6ad6cc8
OMPI_MPI_THREAD_LEVEL can now take 'multiple' 'MPI_THREAD_MULTIPLE'
abouteiller Jun 13, 2025
2d5505c
docs: numerous updates to MPI_Init*/MPI_Finalize*/MPI_Session_* man p…
jsquyres Jun 21, 2025
1bea4f7
Add missing file MPI_Session_c2f.3.rst referenced from MPI_Session_in…
abouteiller Jul 10, 2025
91a8d34
Update hardcoded version values in documentation for Init_threads
abouteiller Jul 10, 2025
1475489
fortran: fix ompi string c2f where len(fstr) < len(cstr)
jsquyres Aug 26, 2025
cc72cc7
fortran: fix off-by-one string copy error
jsquyres Aug 27, 2025
9c7e2f4
docs/mca.rst: fix MCA environment variable prefix for PRRTE
phil-blain Aug 28, 2025
0f471d4
Merge pull request #13382 from jsquyres/pr/v5.0.x/fix-fortran-c2f-str…
janjust Sep 8, 2025
3f02701
Merge pull request #13389 from phil-blain/doc-mca-prrte-env-var-prefi…
janjust Sep 8, 2025
30821f8
Merge pull request #13329 from abouteiller/bugfix/env-thread-level-ig…
janjust Sep 9, 2025
b357357
Update submodules to latest PMIx/PRRTE releases
rhc54 Sep 4, 2025
9be4387
Merge pull request #13395 from rhc54/cmr50/check
janjust Sep 11, 2025
d0a7aff
Fix bug in MCA_PML_OB1_ADD_ACK_TO_PENDING that causes memory overruns…
hjelmn Sep 19, 2025
359a19f
Merge pull request #13409 from hjelmn/v5.0.x_fix_pml_ob1_bug_where_pe…
janjust Sep 23, 2025
2a08db2
v5.0.x: prepare v5.0.9rc1 release
janjust Sep 23, 2025
fa0a52b
OMPI/MCA/PML/UCX: Set node local id - v5.0.x
brminich Sep 24, 2025
e3beb10
COLL/UCC: set node local id
Sergei-Lebedev Sep 25, 2025
237cdcc
Merge pull request #13412 from janjust/v5.0.x
janjust Sep 26, 2025
43a7a16
Merge pull request #13418 from Sergei-Lebedev/topic/ucc_set_local_id_v5
janjust Sep 29, 2025
6b190d8
Merge pull request #13414 from brminich/ucx/add_local_id_5.0.x
janjust Sep 29, 2025
384f57a
Only pick one CUDA
bosilca Oct 1, 2025
b156808
Fix `see-also` errors in the document.
xbw22109 Oct 15, 2025
0645ff0
Merge pull request #13434 from janjust/v5.0.x
janjust Oct 15, 2025
314d738
Update history.rst (spelling)
charlesgwaldman Oct 14, 2025
552f601
Merge pull request #13441 from jsquyres/pr/v5.0.x/docs-update
janjust Oct 15, 2025
8050607
NVIDIA github workflows: use unique workflow names
jsquyres Oct 15, 2025
f64e9f7
Merge pull request #13446 from jsquyres/pr/v5.0.x/rename-nvidia-githu…
janjust Oct 15, 2025
04d592f
Merge pull request #13442 from jsquyres/pr/v5.0.x/docs-spelling-fix
janjust Oct 15, 2025
37bf448
v5.0.x: prepare v5.0.9rc2 release
janjust Oct 10, 2025
e982ef6
Merge pull request #13448 from janjust/v5.0.x
janjust Oct 15, 2025
8d88926
COLL/UCC: Fix initialization in non-blocking and persistent
Oct 15, 2025
c5038b5
Merge pull request #13459 from mentOS31/v5.0.x-coll_ucc_fix_initializ…
janjust Oct 27, 2025
6fe1db1
v5.0.9: consolidate news.
janjust Oct 30, 2025
b79100b
Merge pull request #13489 from janjust/v5.0.x
janjust Oct 30, 2025
2c46af3
Merge tag 'v5.0.9' into v5.0.x-aws
bwbarrett Nov 24, 2025
655d661
btl/ofi: Set domain threading model based on MPI thread support
jiaxiyan Oct 14, 2025
84c0e93
btl/ofi: Add FI_COMPLETION flag to tx and rx attributes
jiaxiyan Oct 14, 2025
29382f3
ofi: Share domain between MTL and BTL
jiaxiyan Oct 7, 2025
22b7e2e
dist: Prep for 5.0.9amzn1 release
bwbarrett Nov 24, 2025
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
16 changes: 8 additions & 8 deletions .github/workflows/ompi_nvidia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ompi_NVIDIA CI
on: [pull_request]
jobs:

deployment:
nvidia_deployment:
if: github.repository == 'open-mpi/ompi'
runs-on: [self-hosted, linux, x64, nvidia]
steps:
Expand All @@ -17,25 +17,25 @@ jobs:
path: ompi_ci
- name: Deployment infrastructure
run: /start deploy
build:
needs: [deployment]
nvidia_build:
needs: [nvidia_deployment]
runs-on: [self-hosted, linux, x64, nvidia]
steps:
- name: Building OMPI,UCX and tests
run: /start build
test:
needs: [deployment, build]
nvidia_test:
needs: [nvidia_deployment, nvidia_build]
runs-on: [self-hosted, linux, x64, nvidia]
steps:
- name: Running tests
run: /start test
clean:
# always() should be used to run "clean" even when the workflow was canceled
nvidia_clean:
# always() should be used to run "clean" even when the workflow was canceled
# ( in case of the right repository name)
# The second condition doesn't work when the workflow was canceled

if: always() && (github.repository == 'open-mpi/ompi')
needs: [deployment, build, test]
needs: [nvidia_deployment, nvidia_build, nvidia_test]
runs-on: [self-hosted, linux, x64, nvidia]
steps:
- name: Cleaning
Expand Down
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ George Katevenis <gkatev@ics.forth.gr>
Brian Barrett <brian@bbarrett.org>

Andrii Bilokur <abilokur@nvidia.com> B-a-S <abilokur@nvidia.com>

Kento Hasegawa <hasegawa.kento@fujitsu.com> hasegawa.kento <hasegawa.kento@fujitsu.com>
2 changes: 1 addition & 1 deletion 3rd-party/openpmix
Submodule openpmix updated 52 files
+58 −0 .github/actions/build-python-bindings/action.yaml
+42 −0 .github/workflows/python-bindings.yaml
+207 −53 .github/workflows/run-xversion.yml
+2 −2 VERSION
+4 −1 bindings/python/pmix.pxi
+1 −1 config/oac
+2 −13 config/pmix.m4
+18 −2 config/pmix_config_threads.m4
+3 −0 contrib/construct_dictionary.py
+41 −0 docs/news/news-v5.x.rst
+6 −1 examples/debugger.c
+6 −3 examples/hello.c
+6 −3 examples/tool.c
+29 −14 examples/toolqry.c
+2 −3 include/pmix.h
+12 −2 include/pmix_common.h.in
+19 −0 include/pmix_deprecated.h
+8 −1 src/class/pmix_bitmap.c
+50 −6 src/client/pmix_client.c
+0 −3 src/common/pmix_attributes.c
+1 −1 src/common/pmix_iof.c
+4 −0 src/common/pmix_pfexec.c
+1 −2 src/common/pmix_query.c
+9 −4 src/include/pmix_globals.c
+6 −0 src/include/pmix_globals.h
+4 −2 src/mca/base/pmix_mca_base_component_repository.c
+4 −0 src/mca/base/pmix_mca_base_var.c
+120 −1 src/mca/bfrops/base/bfrop_base_fns.c
+2 −0 src/mca/gds/hash/gds_hash.c
+7 −3 src/mca/gds/hash/gds_utils.c
+6 −0 src/mca/gds/hash/process_arrays.c
+2 −2 src/mca/preg/native/preg_native.c
+2 −2 src/mca/preg/preg.h
+5 −3 src/mca/psec/native/psec_native.c
+2 −0 src/mca/ptl/base/base.h
+43 −0 src/mca/ptl/base/help-ptl-base.txt
+31 −3 src/mca/ptl/base/ptl_base_connect.c
+336 −82 src/mca/ptl/base/ptl_base_connection_hdlr.c
+18 −8 src/mca/ptl/base/ptl_base_fns.c
+4 −0 src/mca/ptl/base/ptl_base_frame.c
+5 −5 src/mca/ptl/base/ptl_base_handshake.h
+152 −72 src/mca/ptl/base/ptl_base_listener.c
+3 −1 src/mca/ptl/ptl_types.h
+5 −1 src/runtime/pmix_finalize.c
+36 −10 src/runtime/pmix_init.c
+14 −0 src/runtime/pmix_params.c
+4 −1 src/runtime/pmix_progress_threads.c
+4 −0 src/runtime/pmix_rte.h
+34 −11 src/server/pmix_server.c
+35 −28 src/server/pmix_server_ops.c
+0 −4 src/server/pmix_server_resolve.c
+34 −16 src/tool/pmix_tool.c
2 changes: 1 addition & 1 deletion 3rd-party/prrte
Submodule prrte updated 49 files
+95 −0 .github/workflows/build-ompi-external.yaml
+6 −6 .github/workflows/prte_mpi4py.yaml
+1 −0 .gitignore
+3 −2 VERSION
+14 −0 autogen.pl
+1 −1 config/oac
+14 −2 config/prte_config_threads.m4
+16 −0 config/prte_setup_pmix.m4
+0 −7 configure.ac
+45 −0 docs/news/news-v3.x.rst
+3 −2 examples/Makefile
+3 −2 examples/Makefile.include
+137 −0 examples/abort.c
+2 −1 src/docs/prrte-rst-content/Makefile.am
+1 −1 src/docs/show-help-files/help-prte.txt
+4 −1 src/docs/show-help-files/help-prterun.txt
+6 −4 src/mca/errmgr/dvm/errmgr_dvm.c
+51 −0 src/mca/errmgr/prted/errmgr_prted.c
+5 −0 src/mca/ess/base/ess_base_std_prted.c
+7 −2 src/mca/ess/hnp/ess_hnp_module.c
+3 −2 src/mca/iof/hnp/iof_hnp.c
+9 −7 src/mca/oob/tcp/oob_tcp_connection.c
+56 −74 src/mca/plm/base/plm_base_launch_support.c
+105 −18 src/mca/plm/base/plm_base_receive.c
+2 −2 src/mca/plm/plm_types.h
+18 −4 src/mca/plm/ssh/plm_ssh_module.c
+6 −1 src/mca/rmaps/base/rmaps_base_map_job.c
+20 −1 src/mca/schizo/ompi/schizo-ompi-cli.rstxt
+27 −0 src/mca/schizo/ompi/schizo_ompi.c
+34 −0 src/mca/schizo/prte/schizo_prte.c
+171 −101 src/prted/pmix/pmix_server.c
+340 −93 src/prted/pmix/pmix_server_gen.c
+50 −15 src/prted/pmix/pmix_server_internal.h
+58 −61 src/prted/pmix/pmix_server_queries.c
+296 −36 src/prted/pmix/pmix_server_register_fns.c
+0 −1 src/prted/prte_app_parse.c
+37 −2 src/prted/prted_comm.c
+2 −2 src/rml/rml_types.h
+3 −4 src/runtime/prte_init.c
+26 −5 src/runtime/prte_mca_params.c
+5 −2 src/runtime/prte_progress_threads.c
+33 −26 src/runtime/prte_quit.c
+23 −2 src/tools/prte/prte.c
+12 −9 src/tools/prted/prted.c
+0 −5 src/util/dash_host/dash_host.c
+6 −1 src/util/nidmap.c
+25 −4 src/util/proc_info.c
+6 −1 src/util/proc_info.h
+25 −63 src/util/session_dir.c
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

major=5
minor=0
release=8
release=9

# MPI Standard Compliance Level
mpi_standard_version=3
Expand Down Expand Up @@ -62,7 +62,7 @@ tarball_version=gitclone

# The date when this release was created

date="30 May 2025"
date="15 October 2025"

# The shared library version of each of Open MPI's public libraries.
# These versions are maintained in accordance with the "Library
Expand Down
3 changes: 2 additions & 1 deletion config/ompi_check_ucx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ AC_DEFUN([OMPI_CHECK_UCX],[
UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK,
UCP_OP_ATTR_FLAG_MULTI_SEND,
UCP_MEM_MAP_SYMMETRIC_RKEY,
UCS_MEMORY_TYPE_RDMA],
UCS_MEMORY_TYPE_RDMA,
UCP_PARAM_FIELD_NODE_LOCAL_ID],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS],
Expand Down
4 changes: 2 additions & 2 deletions config/opal_check_cuda.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ AC_ARG_WITH([cuda-libdir],
[Search for CUDA libraries in DIR])],
[],
[AS_IF([test -d "$with_cuda"],
[with_cuda_libdir=$(dirname $(find -H $with_cuda -name libcuda.so 2> /dev/null) 2> /dev/null)],
[with_cuda_libdir=$(dirname $(find -H /usr/local/cuda -name libcuda.so 2> /dev/null) 2> /dev/null)])
[with_cuda_libdir=$(dirname $(find -H $with_cuda -name libcuda.so 2> /dev/null | head -n 1) 2> /dev/null)],
[with_cuda_libdir=$(dirname $(find -H /usr/local/cuda -name libcuda.so 2> /dev/null) 2> /dev/null | head -n 1)])
])

# Note that CUDA support is off by default. To turn it on, the user has to
Expand Down
2 changes: 1 addition & 1 deletion docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Open MPI represents the merger of three prior MPI implementations:
center and later migrated to the University of Notre Dame.
#. LA-MPI: from the US Department of Energy Los Alamos National
Laboratory.
#. FT-MPI: from the University of Tennassee at Knoxville. One of the
#. FT-MPI: from the University of Tennessee at Knoxville. One of the
UTK developers moved back to the University of Stuttgart in late
2004, which effectively added their team into the project.

Expand Down
114 changes: 70 additions & 44 deletions docs/man-openmpi/man3/MPI_Finalize.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MPI_Finalize

.. include_body

:ref:`MPI_Finalize` |mdash| Terminates MPI execution environment.
:ref:`MPI_Finalize` |mdash| Terminates MPI world model.

SYNTAX
------
Expand Down Expand Up @@ -48,56 +48,82 @@ OUTPUT PARAMETER
DESCRIPTION
-----------

This routine cleans up all MPI states. Once this routine is called, no
MPI routine (not even MPI_Init) may be called, except for
:ref:`MPI_Get_version`, :ref:`MPI_Initialized`, and :ref:`MPI_Finalized`. Unless there has
been a call to :ref:`MPI_Abort`, you must ensure that all pending
communications involving a process are complete before the process calls
:ref:`MPI_Finalize`. If the call returns, each process may either continue
local computations or exit without participating in further
communication with other processes. At the moment when the last process
calls :ref:`MPI_Finalize`, all pending sends must be matched by a receive, and
all pending receives must be matched by a send.

:ref:`MPI_Finalize` is collective over all connected processes. If no processes
were spawned, accepted, or connected, then this means it is collective
over MPI_COMM_WORLD. Otherwise, it is collective over the union of all
processes that have been and continue to be connected.
This routine finalizes the MPI world model. If the MPI world model
has been initialized in an MPI process, it *must* be finalized exactly
once by invoking this routine during the lifetime of that MPI process.
This is different than the MPI session model, which can be initialized
and finalized multiple times in an MPI process. See
:ref:`MPI_Session_init` and :ref:`MPI_Session_finalize`.

Unless there has been a call to :ref:`MPI_Abort`, you must
ensure that all pending communications in the MPI world model
involving a process are complete before the process calls
:ref:`MPI_Finalize`. If the call returns, each process may either
continue local computations or exit without participating in further
communication with other processes in the MPI world model. At the
moment when the last process calls :ref:`MPI_Finalize`, all pending
sends in the MPI world model must be matched by a receive, and all
pending receives in the MPI world model must be matched by a send.

See `MPI-5.0:11.4.1 <https://www.mpi-forum.org/>`_ for a list of MPI
functionality that is available (e.g., even when the MPI
world model has not yet initialized or has already been finalized).

:ref:`MPI_Finalize` is collective over all connected processes. If no
processes were spawned, accepted, or connected, then this means it is
collective over ``MPI_COMM_WORLD``. Otherwise, it is collective over
the union of all processes that have been and continue to be
connected.

NOTES
-----

All processes must call this routine before exiting. All processes will
still exist but may not make any further MPI calls. :ref:`MPI_Finalize`
guarantees that all local actions required by communications the user
has completed will, in fact, occur before it returns. However,
:ref:`MPI_Finalize` guarantees nothing about pending communications that have
not been completed; completion is ensured only by :ref:`MPI_Wait`, :ref:`MPI_Test`, or
:ref:`MPI_Request_free` combined with some other verification of completion.

For example, a successful return from a blocking communication operation
or from :ref:`MPI_Wait` or :ref:`MPI_Test` means that the communication is completed
by the user and the buffer can be reused, but does not guarantee that
the local process has no more work to do. Similarly, a successful return
from :ref:`MPI_Request_free` with a request handle generated by an :ref:`MPI_Isend`
nullifies the handle but does not guarantee that the operation has
completed. The :ref:`MPI_Isend` is complete only when a matching receive has
completed.

If you would like to cause actions to happen when a process finishes,
attach an attribute to MPI_COMM_SELF with a callback function. Then,
when :ref:`MPI_Finalize` is called, it will first execute the equivalent of an
:ref:`MPI_Comm_free` on MPI_COMM_SELF. This will cause the delete callback
function to be executed on all keys associated with MPI_COMM_SELF in an
arbitrary order. If no key has been attached to MPI_COMM_SELF, then no
callback is invoked. This freeing of MPI_COMM_SELF happens before any
other parts of MPI are affected. Calling :ref:`MPI_Finalized` will thus return
"false" in any of these callback functions. Once you have done this with
MPI_COMM_SELF, the results of :ref:`MPI_Finalize` are not specified.
The MPI session model is different than the MPI world model, and has
different scopes of availability for MPI functionality. See
:ref:`MPI_Session_init` and :ref:`MPI_Session_finalize`.

All processes that initialized the MPI world model must call this
routine before exiting. All processes will still exist but may not
make any further MPI calls in the MPI world model. :ref:`MPI_Finalize`
guarantees that all local actions required by communications in the
MPI world model that the user has completed will, in fact, occur
before it returns. However, :ref:`MPI_Finalize` guarantees nothing
about pending communications in the MPI world model that have not been
completed; completion is ensured only by the :ref:`MPI_Wait` and
:ref:`MPI_Test` variants, or :ref:`MPI_Request_free` combined with
some other verification of completion.

For example, a successful return from a blocking communication
operation or from one of the :ref:`MPI_Wait` or :ref:`MPI_Test`
varients means that the communication is completed by the user and the
buffer can be reused, but does not guarantee that the local process
has no more work to do. Similarly, a successful return from
:ref:`MPI_Request_free` with a request handle generated by an
:ref:`MPI_Isend` nullifies the handle but does not guarantee that the
operation has completed. The :ref:`MPI_Isend` is complete only when a
matching receive has completed.

If you would like to cause actions to happen when a process finalizes the MPI
world model, attach an attribute to ``MPI_COMM_SELF`` with a callback
function. Then, when :ref:`MPI_Finalize` is called, it will first
execute the equivalent of an :ref:`MPI_Comm_free` on
``MPI_COMM_SELF``. This will cause the delete callback function to be
executed on all keys associated with ``MPI_COMM_SELF`` in an arbitrary
order. If no key has been attached to ``MPI_COMM_SELF``, then no
callback is invoked. This freeing of ``MPI_COMM_SELF`` happens before
any other parts of the MPI world model are affected. Calling
:ref:`MPI_Finalized` will thus return ``false`` in any of these
callback functions. Once you have done this with ``MPI_COMM_SELF``,
the results of :ref:`MPI_Finalize` are not specified.

ERRORS
------

.. include:: ./ERRORS.rst

.. seealso:: :ref:`MPI_Init`
.. seealso::
* :ref:`MPI_Finalized`
* :ref:`MPI_Init`
* :ref:`MPI_Initialized`
* :ref:`MPI_Session_init`
* :ref:`MPI_Session_finalize`
25 changes: 18 additions & 7 deletions docs/man-openmpi/man3/MPI_Finalized.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MPI_Finalized

.. include_body

:ref:`MPI_Finalized` |mdash| Checks whether MPI has been finalized
:ref:`MPI_Finalized` |mdash| Checks whether the MPI world model has been finalized

SYNTAX
------
Expand Down Expand Up @@ -45,20 +45,31 @@ Fortran 2008 Syntax
OUTPUT PARAMETER
----------------

* ``flag`` : True if MPI was finalized, and false otherwise (logical).
* ``flag`` : True if the MPI world model was finalized, and false
otherwise (logical).
* ``ierror`` : Fortran only: Error status (integer).

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

This routine may be used to determine whether MPI has been finalized. It
is one of a small number of routines that may be called before MPI is
initialized and after MPI has been finalized (:ref:`MPI_Initialized` is
another).
This routine may be used to determine whether the MPI world model has
been finalized. A different routine |mdash| :ref:`MPI_Initialized`
|mdash| is used to indicate whether the MPI world model has been
initialized.

See `MPI-5.0:11.4.1 <https://www.mpi-forum.org/>`_ for a list of MPI
functionality that is available (e.g., even when the MPI
world model has not yet initialized or has already been finalized).

ERRORS
------

.. include:: ./ERRORS.rst

.. seealso:: :ref:`MPI_Init`
.. seealso::
* :ref:`MPI_Init`
* :ref:`MPI_Init_thread`
* :ref:`MPI_Finalize`
* :ref:`MPI_Finalized`
* :ref:`MPI_Session_init`
* :ref:`MPI_Session_finalize`
56 changes: 38 additions & 18 deletions docs/man-openmpi/man3/MPI_Init.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ MPI_Init

.. include_body

:ref:`MPI_Init` |mdash| Initializes the MPI execution environment
:ref:`MPI_Init` |mdash| Initializes the MPI world model


SYNTAX
Expand Down Expand Up @@ -56,35 +56,53 @@ OUTPUT PARAMETER
DESCRIPTION
-----------

This routine, or :ref:`MPI_Init_thread`, must be called before most other MPI
routines are called. There are a small number of errors, such as
:ref:`MPI_Initialized` and :ref:`MPI_Finalized`. MPI can be initialized at most once;
subsequent calls to :ref:`MPI_Init` or :ref:`MPI_Init_thread` are erroneous.
This routine, or :ref:`MPI_Init_thread`, initializes the MPI world
model. Either of these routines must be called before MPI
communication routines are called within the MPI world model. The MPI
world model can be initialized at most exactly once in the lifetime of
an MPI process. This is different than the MPI session model, which
can be initialized and finalized multiple times in an MPI process.
See :ref:`MPI_Session_init` and :ref:`MPI_Session_finalize`.

All MPI programs must contain a call to :ref:`MPI_Init` or :ref:`MPI_Init_thread`.
Open MPI accepts the C *argc* and *argv* arguments to main, but neither
modifies, interprets, nor distributes them:
See `MPI-5.0:11.4.1 <https://www.mpi-forum.org/>`_ for a list of MPI
functionality that is available (e.g., even when the MPI
world model has not yet initialized or has already been finalized).

Open MPI's :ref:`MPI_Init` and :ref:`MPI_Init_thread` both accept the
C *argc* and *argv* arguments to main, but neither modifies,
interprets, nor distributes them:

.. code-block:: c

/* declare variables */
MPI_Init(&argc, &argv);
/* parse arguments */
/* main program */
MPI_Finalize();
#include <mpi.h>

int main(int argv, char *argv[]) {
MPI_Init(&argc, &argv);
/* ...body of main MPI pogram... */
MPI_Finalize();
return 0;
}

By default, :ref:`MPI_Init` is effectively equivalent to invoking
:ref:`MPI_Init_thread` with a *required* value of
``MPI_THREAD_SINGLE``. However, if the ``OMPI_MPI_THREAD_LEVEL``
environment variable is set to a valid value when :ref:`MPI_Init` is
invoked, it is equivalent to invoking :ref:`MPI_Init_thread` with
*required* set to the corresponding value of the ``OMPI_MPI_THREAD_LEVEL``
environment variable. See :ref:`MPI_Init_thread` for more details.

NOTES
-----

The Fortran version does not have provisions for *argc* and *argv* and
takes only IERROR.

The MPI Standard does not say what a program can do before an :ref:`MPI_Init`
or after an :ref:`MPI_Finalize`. In the Open MPI implementation, it should do
as little as possible. In particular, avoid anything that changes the
external state of the program, such as opening files, reading standard
input, or writing to standard output.
The MPI Standard does not specify what a program using the MPI world
model can do before invoking :ref:`MPI_Init` or :ref:`MPI_Init_thread`
or after invoking :ref:`MPI_Finalize`. In the Open MPI implementation,
it should do as little as possible. In particular, avoid anything that
changes the external state of the program, such as opening files,
reading standard input, or writing to standard output.


ERRORS
Expand All @@ -97,3 +115,5 @@ ERRORS
* :ref:`MPI_Initialized`
* :ref:`MPI_Finalize`
* :ref:`MPI_Finalized`
* :ref:`MPI_Session_finalize`
* :ref:`MPI_Session_init`
Loading
Loading