Skip to content

Commit

Permalink
fix: only filter all --kokkos- flags + format
Browse files Browse the repository at this point in the history
  • Loading branch information
dssgabriel committed Jun 14, 2024
1 parent e074e47 commit 2cf2cbc
Showing 1 changed file with 3 additions and 5 deletions.
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

0 comments on commit 2cf2cbc

Please sign in to comment.