25#ifdef DEAL_II_WITH_TBB
26# ifdef DEAL_II_TBB_WITH_ONEAPI
27# include <tbb/global_control.h>
29# include <tbb/task_scheduler_init.h>
34#ifdef DEAL_II_WITH_TASKFLOW
35# include <taskflow/taskflow.hpp>
48 const unsigned int n_cores = std::thread::hardware_concurrency();
61 if (
const char *penv = std::getenv(
"DEAL_II_NUM_THREADS"))
74 "When specifying the <DEAL_II_NUM_THREADS> environment "
75 "variable, it needs to be something that can be interpreted "
76 "as an integer. The text you have in the environment "
83 "When specifying the <DEAL_II_NUM_THREADS> environment "
84 "variable, it needs to be a positive number."));
98#ifdef DEAL_II_WITH_TBB
99# ifdef DEAL_II_TBB_WITH_ONEAPI
108 static std::unique_ptr<tbb::global_control> tbb_global_control;
109 tbb_global_control = std::make_unique<tbb::global_control>(
110 tbb::global_control::max_allowed_parallelism,
n_max_threads);
114 static tbb::task_scheduler_init dummy(tbb::task_scheduler_init::deferred);
115 if (dummy.is_active())
121#ifdef DEAL_II_WITH_TASKFLOW
157 static std::once_flag is_initialized;
158 std::call_once(is_initialized, []() {
165#ifdef DEAL_II_WITH_TASKFLOW
175 "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)
constexpr unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)