From a89e5074952bcb998bd36192b586825574a6a396 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 2 Feb 2015 07:31:37 -0600 Subject: [PATCH] Remove deprecated variable MultithreadInfo::n_default_threads. --- doc/doxygen/headers/multithreading.h | 7 +++++-- doc/news/changes.h | 1 + include/deal.II/base/multithread_info.h | 22 ---------------------- source/base/multithread_info.cc | 1 - tests/bits/step-13.cc | 2 +- tests/bits/step-14.cc | 4 ++-- tests/fail/hp-step-14.cc | 4 ++-- tests/hp/step-13.cc | 2 +- 8 files changed, 12 insertions(+), 31 deletions(-) diff --git a/doc/doxygen/headers/multithreading.h b/doc/doxygen/headers/multithreading.h index 277ae6a380..bf5e29479b 100644 --- a/doc/doxygen/headers/multithreading.h +++ b/doc/doxygen/headers/multithreading.h @@ -1232,8 +1232,11 @@ * that there are no other libraries starting threads. * * Note that a small number of places inside deal.II also uses thread-based - * parallelism controlled by MultithreadInfo::n_default_threads - * generally. Under some circumstances, deal.II also calls the BLAS library + * parallelism explicitly, for example for running background tasks that have + * to wait for input or output to happen and consequently do not consume + * much CPU time. Such threads do not run under the control of the TBB + * task scheduler and, therefore, are not affected by the procedure above. + * Under some circumstances, deal.II also calls the BLAS library * which may sometimes also start threads of its own. You will have to consult * the documentation of your BLAS installation to determine how to set the * number of threads for these operations. diff --git a/doc/news/changes.h b/doc/news/changes.h index 7dc0797df1..c2539cacbb 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -140,6 +140,7 @@ inconvenience this causes. - The MPI support functions in namespace Utilities and Utilities::System. - Deprecated members of namespace types. - Namespace deal_II_numbers. + - MultithreadInfo::n_default_threads.
With headers in deal.II/lac/: diff --git a/include/deal.II/base/multithread_info.h b/include/deal.II/base/multithread_info.h index ba86c5da36..b03f566e04 100644 --- a/include/deal.II/base/multithread_info.h +++ b/include/deal.II/base/multithread_info.h @@ -66,28 +66,6 @@ public: */ const unsigned int n_cpus; - /** - * The number of threads to use as a default value for all functions that - * support multithreading. At start time this is n_cpus or one, if - * detection of the number of CPUs is not possible. - * - * This variable used to be the mechanism by which many parts of the library - * determined how many threads to use, for example when assembling matrices - * in MatrixCreator or generating output in DataOut. To this end, - * n_default_threads is set to n_cpus at the start of the program, but used - * programs could set it to a different value in their main() function. - * However, since almost all of deal.II has now been converted to a task- - * based parallelism model, this variable is no longer used in the library. - * Instead, the task scheduling methods use the n_threads() function as a - * guide to how many threads to use, and the current variable is now - * deprecated. - * - * @deprecated: Use n_threads() to query the number of threads to use (if - * you wanted to read this variable), and set_thread_limit() to limit it (if - * you wanted to write to it). - */ - unsigned int n_default_threads DEAL_II_DEPRECATED; - /** * Returns the number of threads to use. This is initially set to the number * of cores the system has (n_cpus) but can be further restricted by diff --git a/source/base/multithread_info.cc b/source/base/multithread_info.cc index d7d0e0221a..5b7c9d982a 100644 --- a/source/base/multithread_info.cc +++ b/source/base/multithread_info.cc @@ -157,7 +157,6 @@ bool MultithreadInfo::is_running_single_threaded() MultithreadInfo::MultithreadInfo () : n_cpus (get_n_cpus()), - n_default_threads (n_cpus), n_max_threads (numbers::invalid_unsigned_int) {} diff --git a/tests/bits/step-13.cc b/tests/bits/step-13.cc index 3e5ef4abb6..d065a6dc37 100644 --- a/tests/bits/step-13.cc +++ b/tests/bits/step-13.cc @@ -357,7 +357,7 @@ namespace LaplaceSolver typename DoFHandler::active_cell_iterator active_cell_iterator; - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector > thread_ranges = Threads::split_range (dof_handler.begin_active (), diff --git a/tests/bits/step-14.cc b/tests/bits/step-14.cc index f8e910540f..80c2df0789 100644 --- a/tests/bits/step-14.cc +++ b/tests/bits/step-14.cc @@ -443,7 +443,7 @@ namespace LaplaceSolver typename DoFHandler::active_cell_iterator active_cell_iterator; - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector > thread_ranges = Threads::split_range (dof_handler.begin_active (), @@ -1684,7 +1684,7 @@ namespace LaplaceSolver error_indicators.reinit (dual_solver.dof_handler .get_tria().n_active_cells()); - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); for (unsigned int i=0; i::active_cell_iterator active_cell_iterator; - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector > thread_ranges = Threads::split_range (dof_handler.begin_active (), @@ -1684,7 +1684,7 @@ namespace LaplaceSolver error_indicators.reinit (dual_solver.dof_handler .get_tria().n_active_cells()); - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); Threads::ThreadGroup<> threads; for (unsigned int i=0; i::estimate_some, *this, diff --git a/tests/hp/step-13.cc b/tests/hp/step-13.cc index d5179dc58a..cb5882ce55 100644 --- a/tests/hp/step-13.cc +++ b/tests/hp/step-13.cc @@ -357,7 +357,7 @@ namespace LaplaceSolver typename hp::DoFHandler::active_cell_iterator active_cell_iterator; - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector > thread_ranges = Threads::split_range (dof_handler.begin_active (), -- 2.39.5