From 4d7e6a4883c5cefacf5c2c69fd47e0bffc8113dc Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 6 Jan 2022 06:36:58 -0600 Subject: [PATCH] port multithread_info.cc to oneAPI --- source/base/multithread_info.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/base/multithread_info.cc b/source/base/multithread_info.cc index aeed71a479..f9d6c984d2 100644 --- a/source/base/multithread_info.cc +++ b/source/base/multithread_info.cc @@ -22,7 +22,7 @@ #ifdef DEAL_II_WITH_TBB # ifdef DEAL_II_TBB_WITH_ONEAPI -# include +# include # else # include # endif @@ -96,11 +96,16 @@ MultithreadInfo::set_thread_limit(const unsigned int max_threads) n_max_threads = n_cores(); #ifdef DEAL_II_WITH_TBB +# ifdef DEAL_II_TBB_WITH_ONEAPI + tbb::global_control(tbb::global_control::max_allowed_parallelism, + n_max_threads); +# else // Initialize the scheduler and destroy the old one before doing so static tbb::task_scheduler_init dummy(tbb::task_scheduler_init::deferred); if (dummy.is_active()) dummy.terminate(); dummy.initialize(n_max_threads); +# endif #endif #ifdef DEAL_II_WITH_TASKFLOW -- 2.39.5