Skip to content

Commit 2cf2cbc

Browse files
committed
fix: only filter all --kokkos- flags + format
1 parent e074e47 commit 2cf2cbc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/KokkosComm.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ inline void initialize(int &argc, char *argv[], int mpi_required_thread_lvl) {
5555
// Strip "--help" and "--kokkos-help" from the flags passed to Kokkos if we are not on rank 0 to prevent Kokkos
5656
// from printing the help message multiple times.
5757
if (0 != rank) {
58-
auto *help_it = std::find_if(argv, argv + argc,
59-
[](std::string_view const &x) { return x == "--help" || x == "--kokkos-help"; });
58+
auto *help_it = std::find_if(
59+
argv, argv + argc, [](std::string_view const &x) { return x.find("--kokkos-") != std::string_view::npos; });
6060
if (help_it != argv + argc) {
6161
std::swap(*help_it, *(argv + argc - 1));
6262
--argc;
@@ -65,9 +65,7 @@ inline void initialize(int &argc, char *argv[], int mpi_required_thread_lvl) {
6565
Kokkos::initialize(argc, argv);
6666
}
6767

68-
inline void initialize(int &argc, char *argv[]) {
69-
initialize(argc, argv, MPI_THREAD_MULTIPLE);
70-
}
68+
inline void initialize(int &argc, char *argv[]) { initialize(argc, argv, MPI_THREAD_MULTIPLE); }
7169

7270
inline void finalize() {
7371
Kokkos::finalize();

0 commit comments

Comments
 (0)