24#ifdef DEAL_II_WITH_TBB
25# ifdef DEAL_II_TBB_WITH_ONEAPI
26# include <tbb/global_control.h>
28# include <tbb/task_scheduler_init.h>
33#ifdef DEAL_II_WITH_TASKFLOW
34# include <taskflow/taskflow.hpp>
47 const unsigned int n_cores = std::thread::hardware_concurrency();
60 if (
const char *penv = std::getenv(
"DEAL_II_NUM_THREADS"))
73 "When specifying the <DEAL_II_NUM_THREADS> environment "
74 "variable, it needs to be something that can be interpreted "
75 "as an integer. The text you have in the environment "
82 "When specifying the <DEAL_II_NUM_THREADS> environment "
83 "variable, it needs to be a positive number."));
97#ifdef DEAL_II_WITH_TBB
98# ifdef DEAL_II_TBB_WITH_ONEAPI
107 static std::unique_ptr<tbb::global_control> tbb_global_control;
108 tbb_global_control = std::make_unique<tbb::global_control>(
109 tbb::global_control::max_allowed_parallelism,
n_max_threads);
113 static tbb::task_scheduler_init dummy(tbb::task_scheduler_init::deferred);
114 if (dummy.is_active())
120#ifdef DEAL_II_WITH_TASKFLOW
156 static std::once_flag is_initialized;
157 std::call_once(is_initialized, []() {
164#ifdef DEAL_II_WITH_TASKFLOW
174 "Please initialize multithreading using MultithreadInfo::set_thread_limit() first."));
static unsigned int n_max_threads
static bool is_running_single_threaded()
static std::unique_ptr< tf::Executor > executor
static void initialize_multithreading()
static unsigned int n_cores()
static unsigned int n_threads()
static void set_thread_limit(const unsigned int max_threads=numbers::invalid_unsigned_int)
static std::size_t memory_consumption()
static tf::Executor & get_taskflow_executor()
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
int string_to_int(const std::string &s)
static const unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)