From ab4ff583e14739a0bca674e7a01f4e624079186b Mon Sep 17 00:00:00 2001 From: heister Date: Wed, 2 Oct 2013 17:52:30 +0000 Subject: [PATCH] replace n_default_threads by n_threads() git-svn-id: https://svn.dealii.org/trunk@31076 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/multithread_info.h | 2 +- deal.II/include/deal.II/lac/sparse_vanka.h | 11 ++++------- deal.II/include/deal.II/matrix_free/dof_info.h | 3 +-- .../include/deal.II/matrix_free/dof_info.templates.h | 2 +- deal.II/include/deal.II/matrix_free/matrix_free.h | 4 ++-- deal.II/include/deal.II/numerics/data_out_faces.h | 5 +---- deal.II/include/deal.II/numerics/data_out_rotation.h | 5 +---- deal.II/source/dofs/dof_tools_constraints.cc | 4 ++-- deal.II/source/numerics/derivative_approximation.cc | 2 +- deal.II/source/numerics/matrix_tools.cc | 4 ++-- 10 files changed, 16 insertions(+), 26 deletions(-) diff --git a/deal.II/include/deal.II/base/multithread_info.h b/deal.II/include/deal.II/base/multithread_info.h index 38a3f21464..4fca80774a 100644 --- a/deal.II/include/deal.II/base/multithread_info.h +++ b/deal.II/include/deal.II/base/multithread_info.h @@ -93,7 +93,7 @@ public: /* * Returns the number of threads to use. This is governed by the number - * of cores the system has and can be further restricted by + * of cores the system has (n_cpus) and can be further restricted by * set_thread_limit(). */ unsigned int n_threads() const; diff --git a/deal.II/include/deal.II/lac/sparse_vanka.h b/deal.II/include/deal.II/lac/sparse_vanka.h index fba90664de..4fef3f67d1 100644 --- a/deal.II/include/deal.II/lac/sparse_vanka.h +++ b/deal.II/include/deal.II/lac/sparse_vanka.h @@ -55,7 +55,7 @@ template class SparseBlockVanka; * Objects of this class are constructed by passing a vector of indices * of the degrees of freedom of the Lagrange multiplier. In the actual * preconditioning method, these rows are traversed in the order in which - * the appear in the matrix. Since this is a Gauß-Seidel like procedure, + * the appear in the matrix. Since this is a Gau�-Seidel like procedure, * remember to have a good ordering in advance (for transport dominated * problems, Cuthill-McKee algorithms are a good means for this, if points * on the inflow boundary are chosen as starting points for the renumbering). @@ -189,15 +189,12 @@ public: * building the inverses of the * diagonal blocks. This * parameter is ignored if not in - * multithreaded mode. By - * default, this variable is set - * to the value of - * multithread_info.n_default_threads. + * multithreaded mode. */ SparseVanka(const SparseMatrix &M, const std::vector &selected, const bool conserve_memory = false, - const unsigned int n_threads = multithread_info.n_default_threads); + const unsigned int n_threads = multithread_info.n_threads()); /** * Destructor. @@ -546,7 +543,7 @@ public: const unsigned int n_blocks, const BlockingStrategy blocking_strategy, const bool conserve_memory = false, - const unsigned int n_threads = multithread_info.n_default_threads); + const unsigned int n_threads = multithread_info.n_threads()); /** * Apply the preconditioner. diff --git a/deal.II/include/deal.II/matrix_free/dof_info.h b/deal.II/include/deal.II/matrix_free/dof_info.h index d6a4e26612..6fdc4f4928 100644 --- a/deal.II/include/deal.II/matrix_free/dof_info.h +++ b/deal.II/include/deal.II/matrix_free/dof_info.h @@ -208,8 +208,7 @@ namespace internal * This helper function determines a block size if the user decided not * to force a block size through MatrixFree::AdditionalData. This is * computed based on the number of hardware threads on the system - * (multithread_info.n_default_threads) and the number of macro cells - * that we should work on. + * and the number of macro cells that we should work on. */ void guess_block_size (const SizeInfo &size_info, TaskInfo &task_info); diff --git a/deal.II/include/deal.II/matrix_free/dof_info.templates.h b/deal.II/include/deal.II/matrix_free/dof_info.templates.h index 8ab56dcc92..bb7a62128d 100644 --- a/deal.II/include/deal.II/matrix_free/dof_info.templates.h +++ b/deal.II/include/deal.II/matrix_free/dof_info.templates.h @@ -796,7 +796,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_default_threads * 50); + size_info.n_macro_cells / (multithread_info.n_threads() * 50); // if there are too few degrees of freedom per cell, need to // increase the block size diff --git a/deal.II/include/deal.II/matrix_free/matrix_free.h b/deal.II/include/deal.II/matrix_free/matrix_free.h index c3fe2de0f1..8c8b0a83f6 100644 --- a/deal.II/include/deal.II/matrix_free/matrix_free.h +++ b/deal.II/include/deal.II/matrix_free/matrix_free.h @@ -207,8 +207,8 @@ 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 the number of threads stored in - * multithread_info.n_default_threads and the number of cells + * for the blocks based on + * multithread_info.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/deal.II/include/deal.II/numerics/data_out_faces.h b/deal.II/include/deal.II/numerics/data_out_faces.h index defebb091e..ada6d1aa91 100644 --- a/deal.II/include/deal.II/numerics/data_out_faces.h +++ b/deal.II/include/deal.II/numerics/data_out_faces.h @@ -147,10 +147,7 @@ public: * The function supports * multithreading, if deal.II is * compiled in multithreading - * mode. The default number of - * threads to be used to build - * the patches is set to - * multithread_info.n_default_threads. + * mode. */ virtual void build_patches (const unsigned int n_subdivisions = 0); diff --git a/deal.II/include/deal.II/numerics/data_out_rotation.h b/deal.II/include/deal.II/numerics/data_out_rotation.h index bdf5a84778..f8e8d8aa91 100644 --- a/deal.II/include/deal.II/numerics/data_out_rotation.h +++ b/deal.II/include/deal.II/numerics/data_out_rotation.h @@ -150,10 +150,7 @@ public: * The function supports * multithreading, if deal.II is * compiled in multithreading - * mode. The default number of - * threads to be used to build - * the patches is set to - * multithread_info.n_default_threads. + * mode. */ virtual void build_patches (const unsigned int n_patches_per_circle, const unsigned int n_subdivisions = 0); diff --git a/deal.II/source/dofs/dof_tools_constraints.cc b/deal.II/source/dofs/dof_tools_constraints.cc index 4909d3a7b5..d0f497919b 100644 --- a/deal.II/source/dofs/dof_tools_constraints.cc +++ b/deal.II/source/dofs/dof_tools_constraints.cc @@ -2285,7 +2285,7 @@ namespace DoFTools std::vector > cell_intervals = Threads::split_range (coarse_grid.begin_active(), coarse_grid.end(), - multithread_info.n_default_threads); + multithread_info.n_threads()); // TODO: use WorkStream here @@ -2299,7 +2299,7 @@ namespace DoFTools const typename dealii::DoFHandler::active_cell_iterator &, const typename dealii::DoFHandler::active_cell_iterator &) = &compute_intergrid_weights_3; - for (unsigned int i=0; i &mapping, Assert (component < dof_handler.get_fe().n_components(), ExcIndexRange (component, 0, dof_handler.get_fe().n_components())); - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); std::vector index_intervals = Threads::split_interval (0, dof_handler.get_tria().n_active_cells(), n_threads); diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 32119a2330..af0e940cc8 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -1184,7 +1184,7 @@ namespace MatrixCreator else AssertDimension (n_components, component_mapping.size()); - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); Threads::ThreadGroup<> threads; // define starting and end point @@ -1660,7 +1660,7 @@ namespace MatrixCreator else AssertDimension (n_components, component_mapping.size()); - const unsigned int n_threads = multithread_info.n_default_threads; + const unsigned int n_threads = multithread_info.n_threads(); Threads::ThreadGroup<> threads; // define starting and end point -- 2.39.5