|
1 | 1 | Core
|
2 |
| -==== |
| 2 | +**** |
| 3 | + |
| 4 | +MPI API Support |
| 5 | +=============== |
3 | 6 |
|
4 | 7 | .. list-table:: MPI API Support
|
5 | 8 | :widths: 40 30 15
|
6 | 9 | :header-rows: 1
|
7 | 10 |
|
8 | 11 | * - MPI
|
9 |
| - - ``KokkosComm::`` |
| 12 | + - KokkosComm |
10 | 13 | - ``Kokkos::View``
|
11 | 14 | * - ``MPI_Send``
|
12 | 15 | - ``send`` or ``send<CommMode::Standard>``
|
|
33 | 36 | - ``reduce``
|
34 | 37 | - ✓
|
35 | 38 |
|
| 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 | + |
36 | 74 | Point-to-point
|
37 | 75 | --------------
|
38 | 76 |
|
|
0 commit comments