From: Wolfgang Bangerth Date: Fri, 7 Jul 2023 17:39:57 +0000 (-0600) Subject: Use parallel::apply_to_subranges(). X-Git-Tag: relicensing~723^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15679%2Fhead;p=dealii.git Use parallel::apply_to_subranges(). --- diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 7c78c97d08..d0d5d56b82 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -664,11 +664,13 @@ AffineConstraints::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::iterator begin, + const typename std::vector::iterator end) { + for (ConstraintLine &line : boost::iterator_range< + typename std::vector::iterator>(begin, end)) line.entries.erase( std::remove_if(line.entries.begin(), line.entries.end(), @@ -826,11 +828,13 @@ AffineConstraints::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::iterator &begin, + const typename std::vector::iterator &end) { + for (ConstraintLine &line : boost::iterator_range< + typename std::vector::iterator>(begin, end)) { std::sort(line.entries.begin(), line.entries.end(),