Skip to content

Commit 64c4fd4

Browse files
committed
docs(init/fini): add documentation + tiny fixes
1 parent 6229187 commit 64c4fd4

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

docs/api/core.rst

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
Core
2-
====
2+
****
3+
4+
MPI API Support
5+
===============
36

47
.. list-table:: MPI API Support
58
:widths: 40 30 15
69
:header-rows: 1
710

811
* - MPI
9-
- ``KokkosComm::``
12+
- KokkosComm
1013
- ``Kokkos::View``
1114
* - ``MPI_Send``
1215
- ``send`` or ``send<CommMode::Standard>``
@@ -33,6 +36,41 @@ Core
3336
- ``reduce``
3437
- ✓
3538

39+
40+
Initialization and finalization
41+
-------------------------------
42+
43+
KokkosComm provides a unified interface for initializing and finalizing both Kokkos and MPI.
44+
45+
.. Attention:: It is mandatory to use KokkosComm's initialization and finalization functions instead of their respective Kokkos and MPI counterparts.
46+
47+
.. cpp:function:: void KokkosComm::initialize(int &argc, char ***argv)
48+
49+
Initializes the MPI execution environment with ``THREAD_MULTIPLE`` support, and then initializes the Kokkos execution environment. This function also strips ``--kokkos-help`` flags to prevent Kokkos from printing the help on all MPI ranks.
50+
51+
:param argc: Non-negative value representing the number of command-line arguments passed to the program.
52+
:param argv: Pointer to a pointer to the first element of an array of ``argc + 1`` pointers, of which the last one is null and the previous, if any, point to null-terminated multi-byte strings that represent the arguments passed to the program.
53+
54+
**Requirements:**
55+
56+
* ``KokkosComm::initialize`` has the same combined requirements as ``MPI_Init`` and ``Kokkos::initialize``.
57+
* ``KokkosComm::initialize`` must be called in place of ``MPI_Init`` and ``Kokkos::initialize``.
58+
* User-initiated MPI objects cannot be constructed, and MPI functions cannot be called until after ``KokkosComm::initialize`` is called.
59+
* User-initiated Kokkos objects cannot be constructed until after ``KokkosComm::initialize`` is called.
60+
61+
.. cpp:function:: void KokkosComm::finalize()
62+
63+
Terminates the Kokkos and MPI execution environments.
64+
65+
Programs are ill-formed if they do not call this function *after* calling ``KokkosComm::initialize``.
66+
67+
**Requirements:**
68+
69+
* ``KokkosComm::finalize`` has the same combined requirements as ``MPI_Finalize`` and ``Kokkos::finalize``.
70+
* ``KokkosComm::finalize`` must be called in place of ``MPI_Finalize`` and ``Kokkos::finalize``.
71+
* ``KokkosComm::finalize`` must be called after user-initialized Kokkos objects are out of scope.
72+
73+
3674
Point-to-point
3775
--------------
3876

0 commit comments

Comments
 (0)