24#ifndef DUMUX_COMMON_INITIALIZE_HH
25#define DUMUX_COMMON_INITIALIZE_HH
31#include <dune/common/parallel/mpihelper.hh>
34#include <oneapi/tbb/info.h>
35#include <oneapi/tbb/global_control.h>
43 static oneapi::tbb::global_control& instance(
int& argc,
char* argv[])
45 int maxNumThreads = oneapi::tbb::info::default_concurrency();
46 if (
const char* dumuxNumThreads = std::getenv(
"DUMUX_NUM_THREADS"))
47 maxNumThreads = std::max(1, std::stoi(std::string{ dumuxNumThreads }));
49 static oneapi::tbb::global_control global_limit(
50 oneapi::tbb::global_control::max_allowed_parallelism, maxNumThreads
69#include <Kokkos_Core.hpp>
77 static Kokkos::ScopeGuard& instance(
int& argc,
char* argv[])
79 Kokkos::InitArguments arguments;
80 if (
const char* dumuxNumThreads = std::getenv(
"DUMUX_NUM_THREADS"))
81 arguments.num_threads = std::max(1, std::stoi(std::string{ dumuxNumThreads }));
83 static Kokkos::ScopeGuard guard(arguments);
99 Dune::MPIHelper::instance(argc, argv);
103 Detail::TBBGlobalControl::instance(argc, argv);
107 if (
const char* dumuxNumThreads = std::getenv(
"DUMUX_NUM_THREADS"))
109 std::max(1, std::stoi(std::string{ dumuxNumThreads }))
115 Detail::KokkosScopeGuard::instance(argc, argv);
void initialize(int &argc, char *argv[])
Definition: initialize.hh:95
Distance implementation details.
Definition: fclocalassembler.hh:42