From 3d2ae14883e8fdfa695e9cf26f71efd95d1c65c8 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 14 Mar 2017 17:06:39 +0100 Subject: [PATCH] changed signature of internal::VectorOperations::parallel_* functions to be (op,begin,end,...) --- .../lac/la_parallel_vector.templates.h | 42 ++++++++-------- include/deal.II/lac/la_vector.templates.h | 34 ++++++------- .../deal.II/lac/read_write_vector.templates.h | 8 ++-- include/deal.II/lac/vector.templates.h | 48 +++++++++---------- .../deal.II/lac/vector_operations_internal.h | 8 ++-- ...ector_operations_parallel_for_start_end.cc | 5 +- ...or_operations_parallel_reduce_start_end.cc | 7 ++- 7 files changed, 75 insertions(+), 77 deletions(-) diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index fee91499fb..f301534469 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -238,7 +238,7 @@ namespace LinearAlgebra thread_loop_partitioner = v.thread_loop_partitioner; dealii::internal::VectorOperations::Vector_copy copier(v.val, val); - internal::VectorOperations::parallel_for(copier, partitioner->local_size(), + internal::VectorOperations::parallel_for(copier, 0, partitioner->local_size(), thread_loop_partitioner); zero_out_ghosts(); @@ -381,7 +381,7 @@ namespace LinearAlgebra thread_loop_partitioner = c.thread_loop_partitioner; dealii::internal::VectorOperations::Vector_copy copier(c.val, val); - internal::VectorOperations::parallel_for(copier, partitioner->local_size(), + internal::VectorOperations::parallel_for(copier, 0, partitioner->local_size(), thread_loop_partitioner); if (must_update_ghost_values) @@ -928,7 +928,7 @@ namespace LinearAlgebra { internal::VectorOperations::Vector_set setter(s, val); - internal::VectorOperations::parallel_for(setter, partitioner->local_size(), + internal::VectorOperations::parallel_for(setter, 0, partitioner->local_size(), thread_loop_partitioner); // if we call Vector::operator=0, we want to zero out all the entries @@ -953,7 +953,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_add_v vector_add(val, v.val); - internal::VectorOperations::parallel_for(vector_add, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -976,7 +976,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_subtract_v vector_subtract(val, v.val); - internal::VectorOperations::parallel_for(vector_subtract, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_subtract, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -994,7 +994,7 @@ namespace LinearAlgebra AssertIsFinite(a); internal::VectorOperations::Vectorization_add_factor vector_add(val, a); - internal::VectorOperations::parallel_for(vector_add, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1017,7 +1017,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_add_av vector_add(val, v.val, a); - internal::VectorOperations::parallel_for(vector_add, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1049,7 +1049,7 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_avpbw vector_add(val, v.val, w.val, a, b); - internal::VectorOperations::parallel_for(vector_add, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_add, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1081,7 +1081,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_sadd_xv vector_sadd(val, v.val, x); - internal::VectorOperations::parallel_for(vector_sadd, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1106,7 +1106,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_sadd_xav vector_sadd(val, v.val, a, x); - internal::VectorOperations::parallel_for(vector_sadd, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1132,7 +1132,7 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_sadd_xavbw vector_sadd(val, v.val, w.val, x, a, b); - internal::VectorOperations::parallel_for(vector_sadd, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_sadd, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1149,7 +1149,7 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_multiply_factor vector_multiply(val, factor); - internal::VectorOperations::parallel_for(vector_multiply, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_multiply, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1182,7 +1182,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_scale vector_scale(val, v.val); - internal::VectorOperations::parallel_for(vector_scale, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_scale, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1205,7 +1205,7 @@ namespace LinearAlgebra AssertDimension (local_size(), v.local_size()); internal::VectorOperations::Vectorization_equ_au vector_equ(val, v.val, a); - internal::VectorOperations::parallel_for(vector_equ, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_equ, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1229,7 +1229,7 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_equ_aubv vector_equ(val, v.val, w.val, a, b); - internal::VectorOperations::parallel_for(vector_equ, partitioner->local_size(), + internal::VectorOperations::parallel_for(vector_equ, 0, partitioner->local_size(), thread_loop_partitioner); if (vector_is_ghosted) @@ -1282,7 +1282,7 @@ namespace LinearAlgebra Number sum; internal::VectorOperations::Dot dot(val, v.val); - internal::VectorOperations::parallel_reduce (dot, partitioner->local_size(), sum, + internal::VectorOperations::parallel_reduce (dot, 0, partitioner->local_size(), sum, thread_loop_partitioner); AssertIsFinite(sum); @@ -1316,7 +1316,7 @@ namespace LinearAlgebra { real_type sum; internal::VectorOperations::Norm2 norm2(val); - internal::VectorOperations::parallel_reduce (norm2, partitioner->local_size(), sum, + internal::VectorOperations::parallel_reduce (norm2, 0, partitioner->local_size(), sum, thread_loop_partitioner); AssertIsFinite(sum); @@ -1336,7 +1336,7 @@ namespace LinearAlgebra Number sum; internal::VectorOperations::MeanValue mean(val); - internal::VectorOperations::parallel_reduce (mean, partitioner->local_size(), sum, + internal::VectorOperations::parallel_reduce (mean, 0, partitioner->local_size(), sum, thread_loop_partitioner); return sum / real_type(partitioner->local_size()); @@ -1366,7 +1366,7 @@ namespace LinearAlgebra { real_type sum; internal::VectorOperations::Norm1 norm1(val); - internal::VectorOperations::parallel_reduce (norm1, partitioner->local_size(), sum, + internal::VectorOperations::parallel_reduce (norm1, 0, partitioner->local_size(), sum, thread_loop_partitioner); return sum; @@ -1408,7 +1408,7 @@ namespace LinearAlgebra { real_type sum; internal::VectorOperations::NormP normp(val, p); - internal::VectorOperations::parallel_reduce (normp, partitioner->local_size(), sum, + internal::VectorOperations::parallel_reduce (normp, 0, partitioner->local_size(), sum, thread_loop_partitioner); return std::pow(sum, 1./p); } @@ -1472,7 +1472,7 @@ namespace LinearAlgebra Number sum; internal::VectorOperations::AddAndDot adder(this->val, v.val, w.val, a); - internal::VectorOperations::parallel_reduce (adder, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (adder, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); return sum; } diff --git a/include/deal.II/lac/la_vector.templates.h b/include/deal.II/lac/la_vector.templates.h index 09d2e022ba..15fe96fdde 100644 --- a/include/deal.II/lac/la_vector.templates.h +++ b/include/deal.II/lac/la_vector.templates.h @@ -36,7 +36,7 @@ namespace LinearAlgebra this->reinit(in_vector, true); dealii::internal::VectorOperations::Vector_copy copier(in_vector.val, this->val); - internal::VectorOperations::parallel_for(copier, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, 0, this->size(), this->thread_loop_partitioner); return *this; } @@ -52,7 +52,7 @@ namespace LinearAlgebra this->reinit(in_vector, true); dealii::internal::VectorOperations::Vector_copy copier(in_vector.val, this->val); - internal::VectorOperations::parallel_for(copier, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier, 0, this->size(), this->thread_loop_partitioner); return *this; } @@ -66,7 +66,7 @@ namespace LinearAlgebra (void) s; internal::VectorOperations::Vector_set setter(Number(), this->val); - internal::VectorOperations::parallel_for(setter, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(setter, 0, this->size(), this->thread_loop_partitioner); return *this; } @@ -79,7 +79,7 @@ namespace LinearAlgebra AssertIsFinite(factor); internal::VectorOperations::Vectorization_multiply_factor vector_multiply(this->val, factor); - internal::VectorOperations::parallel_for(vector_multiply, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_multiply, 0, this->size(), this->thread_loop_partitioner); return *this; } @@ -110,7 +110,7 @@ namespace LinearAlgebra ExcMessage("Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_add_v vector_add(this->val, down_V.val); - internal::VectorOperations::parallel_for(vector_add, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, 0, this->size(), this->thread_loop_partitioner); return *this; } @@ -128,7 +128,7 @@ namespace LinearAlgebra Assert(down_V.size()==this->size(), ExcMessage("Cannot subtract two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_subtract_v vector_subtract(this->val, down_V.val); - internal::VectorOperations::parallel_for(vector_subtract, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_subtract, 0, this->size(), this->thread_loop_partitioner); return *this; } @@ -149,7 +149,7 @@ namespace LinearAlgebra "of two vectors with different numbers of elements")); Number sum; internal::VectorOperations::Dot dot(this->val, down_V.val); - internal::VectorOperations::parallel_reduce(dot, this->size(), sum, this->thread_loop_partitioner); + internal::VectorOperations::parallel_reduce(dot, 0, this->size(), sum, this->thread_loop_partitioner); return sum; } @@ -173,7 +173,7 @@ namespace LinearAlgebra AssertIsFinite(a); internal::VectorOperations::Vectorization_add_factor vector_add(this->val, a); - internal::VectorOperations::parallel_for(vector_add, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, 0, this->size(), this->thread_loop_partitioner); } @@ -192,7 +192,7 @@ namespace LinearAlgebra ExcMessage("Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_add_av vector_add_av(this->val, down_V.val, a); - internal::VectorOperations::parallel_for(vector_add_av, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add_av, 0, this->size(), this->thread_loop_partitioner); } @@ -221,7 +221,7 @@ namespace LinearAlgebra internal::VectorOperations::Vectorization_add_avpbw vector_add(this->val, down_V.val, down_W.val, a, b); - internal::VectorOperations::parallel_for(vector_add, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add, 0, this->size(), this->thread_loop_partitioner); } @@ -241,7 +241,7 @@ namespace LinearAlgebra const Vector &down_V = dynamic_cast&>(V); internal::VectorOperations::Vectorization_sadd_xav vector_sadd_xav(this->val, down_V.val, a, s); - internal::VectorOperations::parallel_for(vector_sadd_xav, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd_xav, 0, this->size(), this->thread_loop_partitioner); } @@ -260,7 +260,7 @@ namespace LinearAlgebra ExcMessage("Cannot add two vectors with different numbers of elements")); internal::VectorOperations::Vectorization_scale vector_scale(this->val, down_scaling_factors.val); - internal::VectorOperations::parallel_for(vector_scale, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_scale, 0, this->size(), this->thread_loop_partitioner); } @@ -277,7 +277,7 @@ namespace LinearAlgebra // Downcast V. If fails, throws an exception. const Vector &down_V = dynamic_cast&>(V); internal::VectorOperations::Vectorization_equ_au vector_equ(this->val, down_V.val, a); - internal::VectorOperations::parallel_for(vector_equ, this->size(), this->thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ, 0, this->size(), this->thread_loop_partitioner); } @@ -290,7 +290,7 @@ namespace LinearAlgebra typedef typename VectorSpaceVector::real_type real_type; value_type sum; internal::VectorOperations::MeanValue mean_value(this->val); - internal::VectorOperations::parallel_reduce(mean_value, this->size(), sum, this->thread_loop_partitioner); + internal::VectorOperations::parallel_reduce(mean_value, 0, this->size(), sum, this->thread_loop_partitioner); return sum/static_cast(this->size()); } @@ -305,7 +305,7 @@ namespace LinearAlgebra typedef typename VectorSpaceVector::real_type real_type; real_type sum; internal::VectorOperations::Norm1 norm1(this->val); - internal::VectorOperations::parallel_reduce(norm1, this->size(), sum, this->thread_loop_partitioner); + internal::VectorOperations::parallel_reduce(norm1, 0, this->size(), sum, this->thread_loop_partitioner); return sum; } @@ -326,7 +326,7 @@ namespace LinearAlgebra typedef typename VectorSpaceVector::real_type real_type; real_type norm_square; internal::VectorOperations::Norm2 norm2(this->val); - internal::VectorOperations::parallel_reduce(norm2, this->size(), norm_square, + internal::VectorOperations::parallel_reduce(norm2, 0, this->size(), norm_square, this->thread_loop_partitioner); if (numbers::is_finite(norm_square) && norm_square>=std::numeric_limits::min()) @@ -395,7 +395,7 @@ namespace LinearAlgebra Number sum; internal::VectorOperations::AddAndDot adder(this->val, down_V.val, down_W.val, a); - internal::VectorOperations::parallel_reduce(adder, this->size(), sum, this->thread_loop_partitioner); + internal::VectorOperations::parallel_reduce(adder, 0, this->size(), sum, this->thread_loop_partitioner); AssertIsFinite(sum); return sum; diff --git a/include/deal.II/lac/read_write_vector.templates.h b/include/deal.II/lac/read_write_vector.templates.h index e9ad460021..90e9d166a8 100644 --- a/include/deal.II/lac/read_write_vector.templates.h +++ b/include/deal.II/lac/read_write_vector.templates.h @@ -140,7 +140,7 @@ namespace LinearAlgebra ReadWriteVector::apply(const Functor &func) { FunctorTemplate functor(*this, func); - internal::VectorOperations::parallel_for(functor, n_elements(), thread_loop_partitioner); + internal::VectorOperations::parallel_for(functor, 0, n_elements(), thread_loop_partitioner); } #endif @@ -158,7 +158,7 @@ namespace LinearAlgebra reinit(in_vector, true); dealii::internal::VectorOperations::Vector_copy copier(in_vector.val, val); - dealii::internal::VectorOperations::parallel_for(copier, n_elements(), thread_loop_partitioner); + dealii::internal::VectorOperations::parallel_for(copier, 0, n_elements(), thread_loop_partitioner); return *this; } @@ -175,7 +175,7 @@ namespace LinearAlgebra reinit(in_vector, true); dealii::internal::VectorOperations::Vector_copy copier(in_vector.val, val); - dealii::internal::VectorOperations::parallel_for(copier, n_elements(), thread_loop_partitioner); + dealii::internal::VectorOperations::parallel_for(copier, 0, n_elements(), thread_loop_partitioner); return *this; } @@ -190,7 +190,7 @@ namespace LinearAlgebra (void)s; dealii::internal::VectorOperations::Vector_set setter(Number(), val); - dealii::internal::VectorOperations::parallel_for(setter, n_elements(), thread_loop_partitioner); + dealii::internal::VectorOperations::parallel_for(setter, 0, n_elements(), thread_loop_partitioner); return *this; } diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 9a77cd0e00..08ec9c3a41 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -222,7 +222,7 @@ Vector::operator= (const Vector &v) reinit (v, true); dealii::internal::VectorOperations::Vector_copy copier(v.val, val); - internal::VectorOperations::parallel_for(copier,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier,0,vec_size,thread_loop_partitioner); return *this; } @@ -265,7 +265,7 @@ Vector::operator= (const Vector &v) reinit (v, true); dealii::internal::VectorOperations::Vector_copy copier(v.val, val); - internal::VectorOperations::parallel_for(copier,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(copier,0,vec_size,thread_loop_partitioner); return *this; } @@ -376,7 +376,7 @@ Vector::operator= (const Number s) internal::VectorOperations::Vector_set setter(s, val); - internal::VectorOperations::parallel_for(setter,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(setter,0,vec_size,thread_loop_partitioner); return *this; } @@ -392,7 +392,7 @@ Vector &Vector::operator *= (const Number factor) internal::VectorOperations::Vectorization_multiply_factor vector_multiply(val, factor); - internal::VectorOperations::parallel_for(vector_multiply,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_multiply,0,vec_size,thread_loop_partitioner); return *this; } @@ -410,7 +410,7 @@ Vector::add (const Number a, Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size)); internal::VectorOperations::Vectorization_add_av vector_add_av(val, v.val, a); - internal::VectorOperations::parallel_for(vector_add_av,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add_av,0,vec_size,thread_loop_partitioner); } @@ -428,7 +428,7 @@ Vector::sadd (const Number x, Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size)); internal::VectorOperations::Vectorization_sadd_xav vector_sadd_xav(val, v.val, a, x); - internal::VectorOperations::parallel_for(vector_sadd_xav,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd_xav,0,vec_size,thread_loop_partitioner); } @@ -447,7 +447,7 @@ Number Vector::operator * (const Vector &v) const Number sum; internal::VectorOperations::Dot dot(val, v.val); - internal::VectorOperations::parallel_reduce (dot, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (dot, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); return sum; @@ -463,7 +463,7 @@ Vector::norm_sqr () const real_type sum; internal::VectorOperations::Norm2 norm2(val); - internal::VectorOperations::parallel_reduce (norm2, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (norm2, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); @@ -479,7 +479,7 @@ Number Vector::mean_value () const Number sum; internal::VectorOperations::MeanValue mean(val); - internal::VectorOperations::parallel_reduce (mean, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (mean, 0, vec_size, sum, thread_loop_partitioner); return sum / real_type(size()); } @@ -494,7 +494,7 @@ Vector::l1_norm () const real_type sum; internal::VectorOperations::Norm1 norm1(val); - internal::VectorOperations::parallel_reduce (norm1, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (norm1, 0, vec_size, sum, thread_loop_partitioner); return sum; } @@ -514,7 +514,7 @@ Vector::l2_norm () const real_type norm_square; internal::VectorOperations::Norm2 norm2(val); - internal::VectorOperations::parallel_reduce (norm2, vec_size, norm_square, + internal::VectorOperations::parallel_reduce (norm2, 0, vec_size, norm_square, thread_loop_partitioner); if (numbers::is_finite(norm_square) && norm_square >= std::numeric_limits::min()) @@ -558,7 +558,7 @@ Vector::lp_norm (const real_type p) const real_type sum; internal::VectorOperations::NormP normp(val, p); - internal::VectorOperations::parallel_reduce (normp, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (normp, 0, vec_size, sum, thread_loop_partitioner); if (numbers::is_finite(sum) && sum >= std::numeric_limits::min()) return std::pow(sum, static_cast(1./p)); @@ -615,7 +615,7 @@ Vector::add_and_dot (const Number a, Number sum; internal::VectorOperations::AddAndDot adder(this->val, V.val, W.val, a); - internal::VectorOperations::parallel_reduce (adder, vec_size, sum, thread_loop_partitioner); + internal::VectorOperations::parallel_reduce (adder, 0, vec_size, sum, thread_loop_partitioner); AssertIsFinite(sum); return sum; @@ -641,7 +641,7 @@ Vector &Vector::operator -= (const Vector &v) Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size)); internal::VectorOperations::Vectorization_subtract_v vector_subtract(val, v.val); - internal::VectorOperations::parallel_for(vector_subtract,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_subtract,0,vec_size,thread_loop_partitioner); return *this; } @@ -654,7 +654,7 @@ void Vector::add (const Number v) Assert (vec_size!=0, ExcEmptyObject()); internal::VectorOperations::Vectorization_add_factor vector_add(val, v); - internal::VectorOperations::parallel_for(vector_add,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner); } @@ -666,7 +666,7 @@ void Vector::add (const Vector &v) Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size)); internal::VectorOperations::Vectorization_add_v vector_add(val, v.val); - internal::VectorOperations::parallel_for(vector_add,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner); } @@ -683,7 +683,7 @@ void Vector::add (const Number a, const Vector &v, Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size)); internal::VectorOperations::Vectorization_add_avpbw vector_add(val, v.val, w.val, a, b); - internal::VectorOperations::parallel_for(vector_add,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_add,0,vec_size,thread_loop_partitioner); } @@ -698,7 +698,7 @@ void Vector::sadd (const Number x, Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size)); internal::VectorOperations::Vectorization_sadd_xv vector_sadd(val, v.val, x); - internal::VectorOperations::parallel_for(vector_sadd,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd,0,vec_size,thread_loop_partitioner); } @@ -718,7 +718,7 @@ void Vector::sadd (const Number x, const Number a, internal::VectorOperations::Vectorization_sadd_xavbw vector_sadd(val, v.val, w.val, x, a, b); - internal::VectorOperations::parallel_for(vector_sadd,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_sadd,0,vec_size,thread_loop_partitioner); } @@ -741,7 +741,7 @@ void Vector::scale (const Vector &s) Assert (vec_size == s.vec_size, ExcDimensionMismatch(vec_size, s.vec_size)); internal::VectorOperations::Vectorization_scale vector_scale(val, s.val); - internal::VectorOperations::parallel_for(vector_scale,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_scale,0,vec_size,thread_loop_partitioner); } @@ -769,7 +769,7 @@ void Vector::equ (const Number a, Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size)); internal::VectorOperations::Vectorization_equ_au vector_equ(val, u.val, a); - internal::VectorOperations::parallel_for(vector_equ,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ,0,vec_size,thread_loop_partitioner); } @@ -808,7 +808,7 @@ void Vector::equ (const Number a, const Vector &u, Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size)); internal::VectorOperations::Vectorization_equ_aubv vector_equ(val, u.val, v.val, a, b); - internal::VectorOperations::parallel_for(vector_equ,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ,0,vec_size,thread_loop_partitioner); } @@ -824,7 +824,7 @@ void Vector::equ (const Number a, const Vector &u, internal::VectorOperations::Vectorization_equ_aubvcw vector_equ(val, u.val, v.val, w.val, a, b, c); - internal::VectorOperations::parallel_for(vector_equ,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_equ,0,vec_size,thread_loop_partitioner); } @@ -841,7 +841,7 @@ void Vector::ratio (const Vector &a, reinit (a.size(), true); internal::VectorOperations::Vectorization_ratio vector_ratio(val, a.val, b.val); - internal::VectorOperations::parallel_for(vector_ratio,vec_size,thread_loop_partitioner); + internal::VectorOperations::parallel_for(vector_ratio,0,vec_size,thread_loop_partitioner); } diff --git a/include/deal.II/lac/vector_operations_internal.h b/include/deal.II/lac/vector_operations_internal.h index 8b52d1db41..991e1cf1ff 100644 --- a/include/deal.II/lac/vector_operations_internal.h +++ b/include/deal.II/lac/vector_operations_internal.h @@ -159,9 +159,9 @@ namespace internal template void parallel_for(Functor &functor, + size_type start, size_type end, - std_cxx11::shared_ptr &partitioner, - size_type start = 0) + std_cxx11::shared_ptr &partitioner) { #ifdef DEAL_II_WITH_THREADS size_type vec_size = end-start; @@ -1252,10 +1252,10 @@ namespace internal */ template void parallel_reduce (const Operation &op, + const size_type start, const size_type end, ResultType &result, - std_cxx11::shared_ptr &partitioner, - const size_type start = 0) + std_cxx11::shared_ptr &partitioner) { #ifdef DEAL_II_WITH_THREADS size_type vec_size = end-start; diff --git a/tests/lac/vector_operations_parallel_for_start_end.cc b/tests/lac/vector_operations_parallel_for_start_end.cc index d7965dbca4..10cd70b62a 100644 --- a/tests/lac/vector_operations_parallel_for_start_end.cc +++ b/tests/lac/vector_operations_parallel_for_start_end.cc @@ -50,9 +50,8 @@ void check () { const unsigned int begin = i*chunk_size; const unsigned int end = std::min((i+1)*chunk_size, size); - internal::VectorOperations::parallel_for(setter, end, - thread_loop_partitioner, - begin); + internal::VectorOperations::parallel_for(setter, begin, end, + thread_loop_partitioner); } // check values: diff --git a/tests/lac/vector_operations_parallel_reduce_start_end.cc b/tests/lac/vector_operations_parallel_reduce_start_end.cc index 054ba9d46c..e3a84e2dfa 100644 --- a/tests/lac/vector_operations_parallel_reduce_start_end.cc +++ b/tests/lac/vector_operations_parallel_reduce_start_end.cc @@ -47,7 +47,7 @@ void check () internal::VectorOperations::MeanValue mean(val); Number sum_direct = 0.; - internal::VectorOperations::parallel_reduce (mean, size, sum_direct, + internal::VectorOperations::parallel_reduce (mean, 0, size, sum_direct, thread_loop_partitioner); Number sum = 0.; @@ -60,9 +60,8 @@ void check () const unsigned int end = std::min((i+1)*chunk_size, size); Number sum_i = 0.; - internal::VectorOperations::parallel_reduce (mean, end, sum_i, - thread_loop_partitioner, - begin); + internal::VectorOperations::parallel_reduce (mean, begin, end, sum_i, + thread_loop_partitioner); sum+= sum_i; } -- 2.39.5