From 2a9bc9eac10a28431048c2c345f55a3746992cac 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 01d8275914..c78fbd7b8c 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 @@ -90,11 +90,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 } -- 2.39.5