Loading [MathJax]/extensions/TeX/AMSsymbols.js
 Reference documentation for deal.II version 8.5.1
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
parallel.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2009 - 2016 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 
17 #include <deal.II/base/parallel.h>
18 
19 
20 DEAL_II_NAMESPACE_OPEN
21 
22 namespace internal
23 {
24  namespace Vector
25  {
26  // set minimum grain size. this value has been determined by experiments
27  // with the actual ::Vector implementation and takes vectorization
28  // that is done inside most functions of ::Vector into account
29  // (without vectorization, we would land at around 1000). for smaller
30  // values than this, the scheduling overhead will be significant. if the
31  // value becomes too large, on the other hand, the work load cannot be
32  // split into enough chunks and the problem becomes badly balanced. the
33  // tests are documented at https://github.com/dealii/dealii/issues/2496
34  unsigned int minimum_parallel_grain_size = 4096;
35  }
36 
37 
38  namespace SparseMatrix
39  {
40  // set this value to 1/16 of the value of the minimum grain size of
41  // vectors (a factor of 4 because we assume that sparse matrix-vector
42  // products do not vectorize and the other factor of 4 because we expect
43  // at least four entries per row). this rests on the fact that we have to
44  // do a lot more work per row of a matrix than per element of a vector. it
45  // could possibly be reduced even further but that doesn't appear worth it
46  // any more for anything but very small matrices that we don't care that
47  // much about anyway.
48  unsigned int minimum_parallel_grain_size = 256;
49  }
50 }
51 
52 
53 
54 
55 DEAL_II_NAMESPACE_CLOSE