Skip to content

Commit

Permalink
fix: suggestion from Andrey Prokopenko (@aprokop)
Browse files Browse the repository at this point in the history
  • Loading branch information
dssgabriel committed Jun 14, 2024
1 parent cfefa4e commit d3b00de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions docs/api/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ KokkosComm provides a unified interface for initializing and finalizing both Kok
Multiple threads may call MPI, with no restrictions.


.. cpp:function:: void KokkosComm::initialize(int &argc, char *argv[], KokkosComm::ThreadSupportLevel required)
.. cpp:function:: void KokkosComm::initialize(int &argc, char *argv[])
.. cpp:function:: void KokkosComm::initialize(int &argc, char *argv[], KokkosComm::ThreadSupportLevel required = KokkosComm::ThreadSupportLevel::Multiple)

Initializes the MPI execution environment with the required MPI thread level support (``MPI_THREAD_MULTIPLE`` if unspecified), and then initializes the Kokkos execution environment. This function also strips ``--kokkos-help`` flags to prevent Kokkos from printing them on all MPI ranks.
Initializes the MPI execution environment with the required MPI thread level support (``Multiple`` if left unspecified), and then initializes the Kokkos execution environment. This function also strips ``--kokkos-help`` flags to prevent Kokkos from printing them on all MPI ranks.

:param argc: Non-negative value representing the number of command-line arguments passed to the program.
:param argv: 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.
Expand Down
4 changes: 1 addition & 3 deletions src/KokkosComm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum class ThreadSupportLevel {
Multiple = MPI_THREAD_MULTIPLE,
};

inline void initialize(int &argc, char *argv[], ThreadSupportLevel required) {
inline void initialize(int &argc, char *argv[], ThreadSupportLevel required = ThreadSupportLevel::Multiple) {
int flag;
MPI_Initialized(&flag);
// Forbid calling this function if MPI has already been initialized
Expand Down Expand Up @@ -76,8 +76,6 @@ inline void initialize(int &argc, char *argv[], ThreadSupportLevel required) {
Kokkos::initialize(argc, argv);
}

inline void initialize(int &argc, char *argv[]) { initialize(argc, argv, ThreadSupportLevel::Multiple); }

inline void finalize() {
// Forbid calling this function if Kokkos has already been finalized or isn't yet initialized
if (Kokkos::is_finalized() || !Kokkos::is_initialized()) {
Expand Down

0 comments on commit d3b00de

Please sign in to comment.