]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use parallel::apply_to_subranges(). 15679/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Fri, 7 Jul 2023 17:39:57 +0000 (11:39 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Fri, 7 Jul 2023 17:59:27 +0000 (11:59 -0600)
include/deal.II/lac/affine_constraints.templates.h

index 7c78c97d08f2947439450d679cd616dd0933b5f4..d0d5d56b82cb79d6b517023a8ddbb68ab8fdf2a4 100644 (file)
@@ -664,11 +664,13 @@ AffineConstraints<number>::close()
   // appears. obviously, 0*something can be omitted.
   //
   // This can be done in parallel:
-  parallel::internal::parallel_for(
+  parallel::apply_to_subranges(
     lines.begin(),
     lines.end(),
-    [](const auto &range) {
-      for (ConstraintLine &line : range)
+    [](const typename std::vector<ConstraintLine>::iterator begin,
+       const typename std::vector<ConstraintLine>::iterator end) {
+      for (ConstraintLine &line : boost::iterator_range<
+             typename std::vector<ConstraintLine>::iterator>(begin, end))
         line.entries.erase(
           std::remove_if(line.entries.begin(),
                          line.entries.end(),
@@ -826,11 +828,13 @@ AffineConstraints<number>::close()
   //
   // This is again an operation that works on each line separately. It can be
   // run in parallel:
-  parallel::internal::parallel_for(
+  parallel::apply_to_subranges(
     lines.begin(),
     lines.end(),
-    [](const auto &range) {
-      for (ConstraintLine &line : range)
+    [](const typename std::vector<ConstraintLine>::iterator &begin,
+       const typename std::vector<ConstraintLine>::iterator &end) {
+      for (ConstraintLine &line : boost::iterator_range<
+             typename std::vector<ConstraintLine>::iterator>(begin, end))
         {
           std::sort(line.entries.begin(),
                     line.entries.end(),

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.