diff --git a/src/utils/PugsUtils.cpp b/src/utils/PugsUtils.cpp index 76509c611f824ae6993c554360eba0f09e611c48..4e1f521656683b371f488ee90df5d49e061d9c7b 100644 --- a/src/utils/PugsUtils.cpp +++ b/src/utils/PugsUtils.cpp @@ -83,6 +83,7 @@ initialize(int& argc, char* argv[]) parallel::Messenger::create(argc, argv); bool enable_fpe = true; bool enable_signals = true; + int nb_threads = -1; std::string filename; { @@ -97,9 +98,8 @@ initialize(int& argc, char* argv[]) return os.str(); }); - int threads = -1; - app.add_option("--threads", threads, "Number of Kokkos threads") - ->check(CLI::Range(1, std::numeric_limits<decltype(threads)>::max())); + app.add_option("--threads", nb_threads, "Number of Kokkos threads") + ->check(CLI::Range(1, std::numeric_limits<decltype(nb_threads)>::max())); bool enable_color = true; app.add_flag("--color,!--no-color", enable_color, "Colorize console output [default: true]"); @@ -139,7 +139,15 @@ initialize(int& argc, char* argv[]) SignalManager::init(enable_signals); setDefaultOMPEnvironment(); - Kokkos::initialize(argc, argv); + { + Kokkos::InitArguments args; + args.num_threads = nb_threads; + args.num_numa = -1; + args.device_id = -1; + args.disable_warnings = true; + + Kokkos::initialize(args); + } if (ConsoleManager::showPreamble()) { std::cout << "----------------- " << rang::fg::green << "pugs exec info" << rang::fg::reset