]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add some documentation on chunk sizes. 8010/head
authorDavid Wells <drwells@email.unc.edu>
Sun, 5 May 2019 19:12:18 +0000 (15:12 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sun, 5 May 2019 19:14:43 +0000 (15:14 -0400)
This came up on GitHub recently (see issue #7851).

include/deal.II/lac/vector_operations_internal.h

index ab1a9b954f973fccb80ab3c138f19446a1dd6790..d7ff76dd363536253a16a530fbe3d9493b80baf5 100644 (file)
@@ -188,6 +188,13 @@ namespace internal
             partitioner->acquire_one_partitioner();
 
           TBBForFunctor<Functor> generic_functor(functor, start, end);
+          // We use a minimum grain size of 1 here since the grains at this
+          // stage of dividing the work refer to the number of vector chunks
+          // that are processed by (possibly different) threads in the
+          // parallelized for loop (i.e., they do not refer to individual
+          // vector entries). The number of chunks here is calculated inside
+          // TBBForFunctor. See also GitHub issue #2496 for further discussion
+          // of this strategy.
           parallel::internal::parallel_for(static_cast<size_type>(0),
                                            static_cast<size_type>(
                                              generic_functor.n_chunks),
@@ -1391,6 +1398,13 @@ namespace internal
           TBBReduceFunctor<Operation, ResultType> generic_functor(op,
                                                                   start,
                                                                   end);
+          // We use a minimum grain size of 1 here since the grains at this
+          // stage of dividing the work refer to the number of vector chunks
+          // that are processed by (possibly different) threads in the
+          // parallelized for loop (i.e., they do not refer to individual
+          // vector entries). The number of chunks here is calculated inside
+          // TBBForFunctor. See also GitHub issue #2496 for further discussion
+          // of this strategy.
           parallel::internal::parallel_for(static_cast<size_type>(0),
                                            static_cast<size_type>(
                                              generic_functor.n_chunks),

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.