Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide KokkosComm::initialize/finalize #88

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
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
8 changes: 3 additions & 5 deletions src/KokkosComm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ inline void initialize(int &argc, char *argv[], int mpi_required_thread_lvl) {
// Strip "--help" and "--kokkos-help" from the flags passed to Kokkos if we are not on rank 0 to prevent Kokkos
// from printing the help message multiple times.
if (0 != rank) {
auto *help_it = std::find_if(argv, argv + argc,
[](std::string_view const &x) { return x == "--help" || x == "--kokkos-help"; });
auto *help_it = std::find_if(
argv, argv + argc, [](std::string_view const &x) { return x.find("--kokkos-") != std::string_view::npos; });
if (help_it != argv + argc) {
std::swap(*help_it, *(argv + argc - 1));
--argc;
Expand All @@ -65,9 +65,7 @@ inline void initialize(int &argc, char *argv[], int mpi_required_thread_lvl) {
Kokkos::initialize(argc, argv);
}

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

inline void finalize() {
Kokkos::finalize();
Expand Down