From 5c9cbcc1ae66d924f5437c5372a84d1099b7c3c2 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 17 Feb 2015 06:12:46 -0500 Subject: [PATCH] more multithread_info deprecation fixes --- include/deal.II/base/multithread_info.h | 9 ++++----- include/deal.II/lac/sparse_vanka.h | 4 ++-- include/deal.II/lac/vector.templates.h | 6 +++--- include/deal.II/matrix_free/dof_info.templates.h | 2 +- include/deal.II/matrix_free/matrix_free.h | 2 +- include/deal.II/matrix_free/matrix_free.templates.h | 4 ++-- tests/base/task_09.cc | 2 +- tests/quick_tests/affinity.cc | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/include/deal.II/base/multithread_info.h b/include/deal.II/base/multithread_info.h index 5863f9e2ba..df2951b350 100644 --- a/include/deal.II/base/multithread_info.h +++ b/include/deal.II/base/multithread_info.h @@ -37,10 +37,9 @@ DEAL_II_NAMESPACE_OPEN * @ref threads * for more information on this. Thread-based parallel methods need to * explicitly created threads and may want to use a number of threads that is - * related to the number of CPUs in your system. This can be queried using the - * variable multithread_info.n_cpus; of a global variable - * multithread_info of this class that, or using - * multithread_info.n_threads(); + * related to the number of CPUs in your system. The recommended number of threads + * can be queried using MultithreadInfo::n_threads(), while the number of cores + * in the system is returned by MultithreadInfo::n_cores(). * * @ingroup threads * @author Thomas Richter, Wolfgang Bangerth, 2000 @@ -66,7 +65,7 @@ public: /** * 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 + * of cores the system has (see n_cores()) but can be further restricted by * set_thread_limit(). */ static unsigned int n_threads (); diff --git a/include/deal.II/lac/sparse_vanka.h b/include/deal.II/lac/sparse_vanka.h index d184d6f3bb..07aba26129 100644 --- a/include/deal.II/lac/sparse_vanka.h +++ b/include/deal.II/lac/sparse_vanka.h @@ -165,7 +165,7 @@ public: SparseVanka(const SparseMatrix &M, const std::vector &selected, const bool conserve_memory = false, - const unsigned int n_threads = multithread_info.n_threads()); + const unsigned int n_threads = MultithreadInfo::n_threads()); /** * Destructor. Delete all allocated matrices. @@ -441,7 +441,7 @@ public: const unsigned int n_blocks, const BlockingStrategy blocking_strategy, const bool conserve_memory = false, - const unsigned int n_threads = multithread_info.n_threads()); + const unsigned int n_threads = MultithreadInfo::n_threads()); /** * Apply the preconditioner. diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 6b91b2883e..942f1f9cbd 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -1150,7 +1150,7 @@ namespace internal result = outer_results[0]; } #ifdef DEAL_II_WITH_THREADS - else if (multithread_info.n_threads() > 1 && + else if (MultithreadInfo::n_threads() > 1 && vec_size > 4 * internal::Vector::minimum_parallel_grain_size && depth != 0) { @@ -1161,10 +1161,10 @@ namespace internal // find out how many recursions we should make (avoid too deep // hierarchies of tasks on large vectors), max use 8 * - // multithread_info.n_threads() + // MultithreadInfo::n_threads() int next_depth = depth; if (depth == -1) - next_depth = 8 * multithread_info.n_threads(); + next_depth = 8 * MultithreadInfo::n_threads(); next_depth /= 4; Threads::TaskGroup<> task_group; diff --git a/include/deal.II/matrix_free/dof_info.templates.h b/include/deal.II/matrix_free/dof_info.templates.h index bec5ee59c3..ca4049c55d 100644 --- a/include/deal.II/matrix_free/dof_info.templates.h +++ b/include/deal.II/matrix_free/dof_info.templates.h @@ -795,7 +795,7 @@ no_constraint: // we would like to have enough work to do, so as first guess, try // to get 50 times as many chunks as we have threads on the system. task_info.block_size = - size_info.n_macro_cells / (multithread_info.n_threads() * 50); + size_info.n_macro_cells / (MultithreadInfo::n_threads() * 50); // if there are too few degrees of freedom per cell, need to // increase the block size diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 6c4dd27690..fd4220502b 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -203,7 +203,7 @@ public: /** * Sets the number of so-called macro cells that should form one * partition. If zero size is given, the class tries to find a good size - * for the blocks based on multithread_info.n_threads() and the number of + * for the blocks based on MultithreadInfo::n_threads() and the number of * cells present. Otherwise, the given number is used. If the given number * is larger than one third of the number of total cells, this means no * parallelism. Note that in the case vectorization is used, a macro cell diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 67f8264a09..d62b1fd062 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -157,7 +157,7 @@ internal_reinit(const Mapping &mapping, // passed to the DoFInfo structure #ifdef DEAL_II_WITH_THREADS if (additional_data.tasks_parallel_scheme != AdditionalData::none && - multithread_info.n_threads() > 1) + MultithreadInfo::n_threads() > 1) { task_info.use_multithreading = true; task_info.block_size = additional_data.tasks_block_size; @@ -287,7 +287,7 @@ internal_reinit(const Mapping &mapping, // passed to the DoFInfo structure #ifdef DEAL_II_WITH_THREADS if (additional_data.tasks_parallel_scheme != AdditionalData::none && - multithread_info.n_threads() > 1) + MultithreadInfo::n_threads() > 1) { task_info.use_multithreading = true; task_info.block_size = additional_data.tasks_block_size; diff --git a/tests/base/task_09.cc b/tests/base/task_09.cc index 238c8efc18..943b0dc5d1 100644 --- a/tests/base/task_09.cc +++ b/tests/base/task_09.cc @@ -66,7 +66,7 @@ int main() deallog.depth_console(0); deallog.threshold_double(1.e-10); - for (unsigned int i=0; i