From: David Wells Date: Sun, 5 May 2019 19:12:18 +0000 (-0400) Subject: Add some documentation on chunk sizes. X-Git-Tag: v9.1.0-rc1~129^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4353832084af0f2830d5a6b5be213c2b055592d3;p=dealii.git Add some documentation on chunk sizes. This came up on GitHub recently (see issue #7851). --- diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index ab1a9b954f..d7ff76dd36 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -188,6 +188,13 @@ namespace internal partitioner->acquire_one_partitioner(); TBBForFunctor 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(0), static_cast( generic_functor.n_chunks), @@ -1391,6 +1398,13 @@ namespace internal TBBReduceFunctor 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(0), static_cast( generic_functor.n_chunks),