From 8f1c50b0d6d8cf1c747290ca69568a3151f68e37 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Wed, 9 Jul 2014 08:57:26 +0000 Subject: [PATCH] Use alias to refer to multithreaded methods. git-svn-id: https://svn.dealii.org/trunk@33119 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/doxygen/options.dox.in | 2 + deal.II/include/deal.II/base/aligned_vector.h | 15 ++-- deal.II/include/deal.II/lac/full_matrix.h | 8 +- deal.II/include/deal.II/lac/parallel_vector.h | 9 ++- deal.II/include/deal.II/lac/sparse_matrix.h | 18 ++--- .../deal.II/lac/trilinos_precondition.h | 4 +- deal.II/include/deal.II/lac/trilinos_solver.h | 4 +- deal.II/include/deal.II/lac/vector.h | 78 +++++++------------ 8 files changed, 54 insertions(+), 84 deletions(-) diff --git a/deal.II/doc/doxygen/options.dox.in b/deal.II/doc/doxygen/options.dox.in index 30da7998ad..c63fbace81 100644 --- a/deal.II/doc/doxygen/options.dox.in +++ b/deal.II/doc/doxygen/options.dox.in @@ -74,6 +74,8 @@ FILTER_SOURCE_FILES = YES ALIASES += dealiiRequiresUpdateFlags{1}="@note For this function to work properly, the underlying FEValues, FEFaceValues, or FESubfaceValues object on which you call it must have computed the information you are requesting. To do so, the \1 flag must be an element of the list of UpdateFlags that you passed to the constructor of this object. See @ref UpdateFlagsEssay for more information." +ALIASES += dealiiOperationIsMultithreaded="@note If deal.II is configured with threads, this operation will run multi-threaded by splitting the work into smaller chunks (assuming there is enough work to make this worthwhile)." + #--------------------------------------------------------------------------- # configuration options related to source browsing diff --git a/deal.II/include/deal.II/base/aligned_vector.h b/deal.II/include/deal.II/base/aligned_vector.h index e6decccd45..0c7539838c 100644 --- a/deal.II/include/deal.II/base/aligned_vector.h +++ b/deal.II/include/deal.II/base/aligned_vector.h @@ -78,8 +78,7 @@ public: * Sets the vector size to the given size and initializes all elements with * T(). * - * @note If deal.II is configured with threads, the initialization will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ AlignedVector (const size_type size, const T &init = T()); @@ -92,16 +91,14 @@ public: /** * Copy constructor. * - * @note If deal.II is configured with threads, the initialization will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ AlignedVector (const AlignedVector &vec); /** * Assignment to the input vector @p vec. * - * @note If deal.II is configured with threads, the initialization will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ AlignedVector & operator = (const AlignedVector &vec); @@ -119,8 +116,7 @@ public: * new vector size is shorter than the old one, the memory is not released * unless the new size is zero. * - * @note If deal.II is configured with threads, the initialization will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void resize (const size_type size_in, const T &init = T()); @@ -169,8 +165,7 @@ public: /** * Fills the vector with size() copies of the given input. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void fill (const T &element); diff --git a/deal.II/include/deal.II/lac/full_matrix.h b/deal.II/include/deal.II/lac/full_matrix.h index 4d7ada0229..ba1829c894 100644 --- a/deal.II/include/deal.II/lac/full_matrix.h +++ b/deal.II/include/deal.II/lac/full_matrix.h @@ -1,7 +1,7 @@ // --------------------------------------------------------------------- // $Id$ // -// Copyright (C) 1999 - 2013 by the deal.II authors +// Copyright (C) 1999 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -269,8 +269,7 @@ public: /** * Assignment operator. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded (if the number of matrix entries is larger than 20,000). + * @dealiiOperationIsMultithreaded */ FullMatrix & operator = (const FullMatrix &); @@ -287,8 +286,7 @@ public: * semantics of this function, zero is the only value allowed for * d, allowing you to clear a matrix in an intuitive way. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded (if the number of matrix entries is larger than 20,000). + * @dealiiOperationIsMultithreaded */ FullMatrix & operator = (const number d); diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h index cdf3160876..44c91f1745 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.h +++ b/deal.II/include/deal.II/lac/parallel_vector.h @@ -1,7 +1,7 @@ // --------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2011 - 2013 by the deal.II authors +// Copyright (C) 2011 - 2014 by the deal.II authors // // This file is part of the deal.II library. // @@ -124,6 +124,13 @@ namespace parallel * ghost entries in the vector layout (for that information, use * n_ghost_entries() instead). * + * This vector uses the facilities of the class dealii::Vector for + * implementing the operations on the local range of the vector. In + * particular, it also inherits thread parallelism that splits most + * vector-vector operations into smaller chunks if the program uses + * multiple threads. This may or may not be desired when working also with + * MPI. + * * @author Katharina Kormann, Martin Kronbichler, 2010, 2011 */ template diff --git a/deal.II/include/deal.II/lac/sparse_matrix.h b/deal.II/include/deal.II/lac/sparse_matrix.h index b0e1631ea1..aea1f1bf8f 100644 --- a/deal.II/include/deal.II/lac/sparse_matrix.h +++ b/deal.II/include/deal.II/lac/sparse_matrix.h @@ -633,8 +633,7 @@ public: * all elements of the matrix to zero, but keep the sparsity pattern * previously used. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded by splitting the work over matrix rows. + * @dealiiOperationIsMultithreaded */ SparseMatrix &operator = (const double d); @@ -1078,8 +1077,7 @@ public: * * Source and destination must not be the same vector. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded by splitting the work over matrix rows. + * @dealiiOperationIsMultithreaded */ template void vmult (OutVector &dst, @@ -1116,8 +1114,7 @@ public: * * Source and destination must not be the same vector. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded by splitting the work over matrix rows. + * @dealiiOperationIsMultithreaded */ template void vmult_add (OutVector &dst, @@ -1156,8 +1153,7 @@ public: * should either both be real or complex-valued, but not mixed, for this * function to make sense. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded by splitting the work over matrix rows. + * @dealiiOperationIsMultithreaded */ template somenumber matrix_norm_square (const Vector &v) const; @@ -1165,8 +1161,7 @@ public: /** * Compute the matrix scalar product $\left(u,Mv\right)$. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded by splitting the work over matrix rows. + * @dealiiOperationIsMultithreaded */ template somenumber matrix_scalar_product (const Vector &u, @@ -1179,8 +1174,7 @@ public: * * Source x and destination dst must not be the same vector. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded by splitting the work over matrix rows. + * @dealiiOperationIsMultithreaded */ template somenumber residual (Vector &dst, diff --git a/deal.II/include/deal.II/lac/trilinos_precondition.h b/deal.II/include/deal.II/lac/trilinos_precondition.h index c1ceb62471..11ecf25339 100644 --- a/deal.II/include/deal.II/lac/trilinos_precondition.h +++ b/deal.II/include/deal.II/lac/trilinos_precondition.h @@ -1416,7 +1416,7 @@ namespace TrilinosWrappers /** * Determines which smoother to use for the AMG cycle. Possibilities * for smoother_type are the following: - *
    + *
      *
    • "Aztec"
    • *
    • "IFPACK"
    • *
    • "Jacobi"
    • @@ -1445,7 +1445,7 @@ namespace TrilinosWrappers *
    • "ILUT"
    • *
    • "Block Chebyshev"
    • *
    • "IFPACK-Block Chebyshev"
    • - *
+ * */ const char* smoother_type; diff --git a/deal.II/include/deal.II/lac/trilinos_solver.h b/deal.II/include/deal.II/lac/trilinos_solver.h index 9ccc910391..4c3fd84052 100644 --- a/deal.II/include/deal.II/lac/trilinos_solver.h +++ b/deal.II/include/deal.II/lac/trilinos_solver.h @@ -529,7 +529,7 @@ namespace TrilinosWrappers /** * Set the solver type (for third party solver support of Trilinos * Amesos package). Possibilities are: - *
    + *
      *
    • "Amesos_Lapack"
    • *
    • "Amesos_Scalapack"
    • *
    • "Amesos_Klu"
    • @@ -540,7 +540,7 @@ namespace TrilinosWrappers *
    • "Amesos_Superludist"
    • *
    • "Amesos_Dscpack"
    • *
    • "Amesos_Mumps"
    • - *
+ * * Note that the availability of these solvers in deal.II depends on * which solvers were set when configuring Trilinos. */ diff --git a/deal.II/include/deal.II/lac/vector.h b/deal.II/include/deal.II/lac/vector.h index 9adec866d2..253f79d46f 100644 --- a/deal.II/include/deal.II/lac/vector.h +++ b/deal.II/include/deal.II/lac/vector.h @@ -327,24 +327,21 @@ public: * v=0. Assigning other values is deprecated and may be disallowed * in the future. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ Vector &operator = (const Number s); /** * Copy the given vector. Resize the present vector if necessary. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ Vector &operator= (const Vector &v); /** * Copy the given vector. Resize the present vector if necessary. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ template Vector &operator= (const Vector &v); @@ -427,8 +424,7 @@ public: * For complex vectors, the scalar product is implemented as * $\left=\sum_i v_i \bar{w_i}$. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. The algorithm uses pairwise + * @dealiiOperationIsMultithreaded The algorithm uses pairwise * summation with the same order of summation in every run, which gives * fully repeatable results from one run to another. */ @@ -438,8 +434,7 @@ public: /** * Return square of the $l_2$-norm. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. The algorithm uses pairwise + * @dealiiOperationIsMultithreaded The algorithm uses pairwise * summation with the same order of summation in every run, which gives * fully repeatable results from one run to another. */ @@ -448,8 +443,7 @@ public: /** * Mean value of the elements of this vector. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. The algorithm uses pairwise + * @dealiiOperationIsMultithreaded The algorithm uses pairwise * summation with the same order of summation in every run, which gives * fully repeatable results from one run to another. */ @@ -458,8 +452,7 @@ public: /** * $l_1$-norm of the vector. The sum of the absolute values. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. The algorithm uses pairwise + * @dealiiOperationIsMultithreaded The algorithm uses pairwise * summation with the same order of summation in every run, which gives * fully repeatable results from one run to another. */ @@ -469,8 +462,7 @@ public: * $l_2$-norm of the vector. The square root of the sum of the squares of * the elements. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. The algorithm uses pairwise + * @dealiiOperationIsMultithreaded The algorithm uses pairwise * summation with the same order of summation in every run, which gives * fully repeatable results from one run to another. */ @@ -480,8 +472,7 @@ public: * $l_p$-norm of the vector. The pth root of the sum of the pth powers of * the absolute values of the elements. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. The algorithm uses pairwise + * @dealiiOperationIsMultithreaded The algorithm uses pairwise * summation with the same order of summation in every run, which gives * fully repeatable results from one run to another. */ @@ -624,16 +615,14 @@ public: /** * Add the given vector to the present one. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ Vector &operator += (const Vector &V); /** * Subtract the given vector from the present one. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ Vector &operator -= (const Vector &V); @@ -667,32 +656,28 @@ public: * Addition of @p s to all components. Note that @p s is a scalar and not a * vector. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void add (const Number s); /** * Simple vector addition, equal to the operator +=. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void add (const Vector &V); /** * Simple addition of a multiple of a vector, i.e. *this += a*V. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void add (const Number a, const Vector &V); /** * Multiple addition of scaled vectors, i.e. *this += a*V+b*W. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void add (const Number a, const Vector &V, const Number b, const Vector &W); @@ -700,8 +685,7 @@ public: /** * Scaling and simple vector addition, i.e. *this = s*(*this)+V. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void sadd (const Number s, const Vector &V); @@ -709,8 +693,7 @@ public: /** * Scaling and simple addition, i.e. *this = s*(*this)+a*V. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void sadd (const Number s, const Number a, @@ -719,8 +702,7 @@ public: /** * Scaling and multiple addition. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void sadd (const Number s, const Number a, @@ -732,8 +714,7 @@ public: * Scaling and multiple addition. *this = s*(*this)+a*V + b*W + * c*X. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void sadd (const Number s, const Number a, @@ -758,16 +739,14 @@ public: /** * Scale each element of the vector by a constant value. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ Vector &operator *= (const Number factor); /** * Scale each element of the vector by the inverse of the given value. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ Vector &operator /= (const Number factor); @@ -776,8 +755,7 @@ public: * argument. This function is mostly meant to simulate multiplication (and * immediate re-assignment) by a diagonal scaling matrix. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void scale (const Vector &scaling_factors); @@ -792,8 +770,7 @@ public: /** * Assignment *this = a*u. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void equ (const Number a, const Vector &u); @@ -806,8 +783,7 @@ public: /** * Assignment *this = a*u + b*v. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void equ (const Number a, const Vector &u, const Number b, const Vector &v); @@ -815,8 +791,7 @@ public: /** * Assignment *this = a*u + b*v + b*w. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void equ (const Number a, const Vector &u, const Number b, const Vector &v, @@ -832,8 +807,7 @@ public: * If any of the b[i] is zero, the result is undefined. No attempt * is made to catch such situations. * - * @note If deal.II is configured with threads, this operation will run - * multi-threaded over subranges of the vector. + * @dealiiOperationIsMultithreaded */ void ratio (const Vector &a, const Vector &b); -- 2.39.5