From 2cf2cbcddaa6dbce55ad47a2e02256eb1b2c89e0 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Santos Date: Fri, 14 Jun 2024 15:04:13 +0200 Subject: [PATCH] fix: only filter all `--kokkos-` flags + format --- src/KokkosComm.hpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/KokkosComm.hpp b/src/KokkosComm.hpp index 88bcc0bb..bab34940 100644 --- a/src/KokkosComm.hpp +++ b/src/KokkosComm.hpp @@ -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; @@ -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();