From 5c921c9c5a9c37eb4c460ffa5a9fae0eefb81744 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 6 Jan 2022 08:35:14 -0600 Subject: [PATCH] disable threading in task_info.cc for oneAPI TBB with oneAPI API has deprecated and removed the tbb::tasks backend. With this it is no longer possible to compile the following code that builds a directed acyclic graph (DAG) of (thread parallel) tasks without a major porting effort. It turned out that such a dynamic handling of dependencies and structures is not as competitive as initially assumed. Consequently, this part of the matrix free infrastructure has seen less attention than the rest over the last years and is (presumably) rarely used. So in case of detected oneAPI backend we simply disable threading in the matrix free backend for now. --- doc/news/changes/minor/20220106BangerthMaier | 5 ++++- .../matrix_free/matrix_free.templates.h | 22 +++++++++++++++++++ source/matrix_free/task_info.cc | 19 ++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/doc/news/changes/minor/20220106BangerthMaier b/doc/news/changes/minor/20220106BangerthMaier index ef8c2e7982..5b75e8638a 100644 --- a/doc/news/changes/minor/20220106BangerthMaier +++ b/doc/news/changes/minor/20220106BangerthMaier @@ -1,4 +1,7 @@ Fixed: deal.II has been updated to support the new OneAPI api interface -introduced by the Intel Threading Building Blocks Library. +introduced by the Intel Threading Building Blocks Library. Note that the +threading support of the matrix-free backend will be disabled in this case: +For now, the MatrixFree::AdditionalData::tasks_parallel_scheme control has +no effect and simply defaults to the serial loop.
(Wolfgang Bangerth, Matthias Maier, 2022/01/06) diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 953195557b..333b4d76c1 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -52,6 +52,24 @@ DEAL_II_ENABLE_EXTRA_DIAGNOSTICS #include +// +// TBB with oneAPI API has deprecated and removed the +// tbb::tasks backend. With this it is no longer possible to +// compile the following code that builds a directed acyclic graph (DAG) of +// (thread parallel) tasks without a major porting effort. It turned out +// that such a dynamic handling of dependencies and structures is not as +// competitive as initially assumed. Consequently, this part of the matrix +// free infrastructure has seen less attention than the rest over the last +// years and is (presumably) not used that often. +// +// In case of detected oneAPI backend we simply disable threading in the +// matrix free backend for now. +// +// Matthias Maier, Martin Kronbichler, 2021 +// +#ifdef DEAL_II_TBB_WITH_ONEAPI +# undef DEAL_II_WITH_TBB +#endif DEAL_II_NAMESPACE_OPEN @@ -2183,4 +2201,8 @@ MatrixFree::print(std::ostream &out) const DEAL_II_NAMESPACE_CLOSE +#ifdef DEAL_II_TBB_WITH_ONEAPI +# define DEAL_II_WITH_TBB +#endif + #endif diff --git a/source/matrix_free/task_info.cc b/source/matrix_free/task_info.cc index 6fd05f036f..755d9fcde9 100644 --- a/source/matrix_free/task_info.cc +++ b/source/matrix_free/task_info.cc @@ -36,6 +36,25 @@ #include #include +// +// TBB with oneAPI API has deprecated and removed the +// tbb::tasks backend. With this it is no longer possible to +// compile the following code that builds a directed acyclic graph (DAG) of +// (thread parallel) tasks without a major porting effort. It turned out +// that such a dynamic handling of dependencies and structures is not as +// competitive as initially assumed. Consequently, this part of the matrix +// free infrastructure has seen less attention than the rest over the last +// years and is (presumably) not used that often. +// +// In case of detected oneAPI backend we simply disable threading in the +// matrix free backend for now. +// +// Matthias Maier, Martin Kronbichler, 2021 +// +#ifdef DEAL_II_TBB_WITH_ONEAPI +# undef DEAL_II_WITH_TBB +#endif + DEAL_II_NAMESPACE_OPEN -- 2.39.5