From 44143e650c39c152cf044e816d656d7aa2c37c30 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 7 Jul 2023 11:39:57 -0600 Subject: [PATCH] Use parallel::apply_to_subranges(). --- .../deal.II/lac/affine_constraints.templates.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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(), -- 2.39.5