From: wolf Date: Mon, 31 Jan 2000 16:30:46 +0000 (+0000) Subject: Small updates. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76e280c76ab6bb52e3fcec77d3cdf91ccad53038;p=dealii-svn.git Small updates. git-svn-id: https://svn.dealii.org/trunk@2297 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/sparse_vanka.h b/deal.II/lac/include/lac/sparse_vanka.h index 1793b35563..9facd46b5d 100644 --- a/deal.II/lac/include/lac/sparse_vanka.h +++ b/deal.II/lac/include/lac/sparse_vanka.h @@ -148,10 +148,19 @@ class SparseVanka * preconditioning are used. This * may lead to different results, * obviously, of #M# changes. + * + * The parameter #n_threads# + * determines how many threads + * shall be used in parallel when + * building the inverses of the + * diagonal blocks. This + * parameter is ignored if not in + * multithreaded mode. */ SparseVanka(const SparseMatrix &M, const vector &selected, - const bool conserve_memory = false); + const bool conserve_memory = false, + const unsigned int n_threads = 1); /** * Destructor. @@ -189,7 +198,15 @@ class SparseVanka /** * Conserve memory flag. */ - bool conserve_mem; + const bool conserve_mem; + + /** + * Number of threads to be used + * when building the + * inverses. Only relevant in + * multithread mode. + */ + const unsigned int n_threads; /** * Array of inverse matrices, diff --git a/deal.II/lac/include/lac/sparse_vanka.templates.h b/deal.II/lac/include/lac/sparse_vanka.templates.h index 02d4e00099..d074beb7e5 100644 --- a/deal.II/lac/include/lac/sparse_vanka.templates.h +++ b/deal.II/lac/include/lac/sparse_vanka.templates.h @@ -18,12 +18,14 @@ template SparseVanka::SparseVanka(const SparseMatrix &M, const vector &selected, - const bool conserve_mem) + const bool conserve_mem, + const unsigned int n_threads) : - matrix(&M), - selected(selected), - conserve_mem(conserve_mem), - inverses(M.m(),0) + matrix (&M), + selected (selected), + n_threads (n_threads), + conserve_mem (conserve_mem), + inverses (M.m(), 0) { Assert (M.m() == M.n(), ExcMatrixNotSquare ()); @@ -52,7 +54,6 @@ void SparseVanka::compute_inverses () { #ifdef DEAL_II_USE_MT - const unsigned int n_threads = 4; const unsigned int n_inverses = count (selected.begin(), selected.end(), true);