]> https://gitweb.dealii.org/ - dealii.git/commitdiff
changed signature of internal::VectorOperations::parallel_* functions to be (op,begin...
authorDenis Davydov <davydden@gmail.com>
Tue, 14 Mar 2017 16:06:39 +0000 (17:06 +0100)
committerDenis Davydov <davydden@gmail.com>
Tue, 14 Mar 2017 16:06:39 +0000 (17:06 +0100)
include/deal.II/lac/la_parallel_vector.templates.h
include/deal.II/lac/la_vector.templates.h
include/deal.II/lac/read_write_vector.templates.h
include/deal.II/lac/vector.templates.h
include/deal.II/lac/vector_operations_internal.h
tests/lac/vector_operations_parallel_for_start_end.cc
tests/lac/vector_operations_parallel_reduce_start_end.cc

index fee91499fb061730f78d915225634118e7729594..f30153446986a31abe0d4488c23ea4732fedbe04 100644 (file)
@@ -238,7 +238,7 @@ namespace LinearAlgebra
 
       thread_loop_partitioner = v.thread_loop_partitioner;
       dealii::internal::VectorOperations::Vector_copy<Number,Number> 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<Number,Number2> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number,Number2> 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<Number,real_type> 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<Number> 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<Number, real_type> 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<Number, real_type> 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<Number> 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;
     }
index 09d2e022ba8fc4e05fddcd75a7cf6d820c1d5301..15fe96fddec6d9d14683ff59a5715309723f92e7 100644 (file)
@@ -36,7 +36,7 @@ namespace LinearAlgebra
       this->reinit(in_vector, true);
 
     dealii::internal::VectorOperations::Vector_copy<Number, Number> 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<Number, Number2> 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<Number> 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<Number> 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<Number> 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<Number> 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<Number, Number> 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<Number> 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<Number> 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<Number> 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<Number> &down_V = dynamic_cast<const Vector<Number>&>(V);
     internal::VectorOperations::Vectorization_sadd_xav<Number> 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<Number> 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<Number> &down_V = dynamic_cast<const Vector<Number>&>(V);
     internal::VectorOperations::Vectorization_equ_au<Number> 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<Number>::real_type real_type;
     value_type sum;
     internal::VectorOperations::MeanValue<Number> 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<real_type>(this->size());
   }
@@ -305,7 +305,7 @@ namespace LinearAlgebra
     typedef typename VectorSpaceVector<Number>::real_type real_type;
     real_type sum;
     internal::VectorOperations::Norm1<Number, real_type> 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<Number>::real_type real_type;
     real_type norm_square;
     internal::VectorOperations::Norm2<Number, real_type> 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<real_type>::min())
@@ -395,7 +395,7 @@ namespace LinearAlgebra
 
     Number sum;
     internal::VectorOperations::AddAndDot<Number> 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;
index e9ad460021b052d3a1dfd1f6c707607e41fd4b45..90e9d166a8faa7dd05a46660e3e405eaee7ba401 100644 (file)
@@ -140,7 +140,7 @@ namespace LinearAlgebra
   ReadWriteVector<Number>::apply(const Functor &func)
   {
     FunctorTemplate<Functor> 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<Number,Number> 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<Number,Number2> 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<Number> 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;
   }
index 9a77cd0e0092d37b97e0e931550c318e8bcf84ab..08ec9c3a410396152349379b976fd2868470f656 100644 (file)
@@ -222,7 +222,7 @@ Vector<Number>::operator= (const Vector<Number> &v)
     reinit (v, true);
 
   dealii::internal::VectorOperations::Vector_copy<Number,Number> 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<Number>::operator= (const Vector<Number2> &v)
     reinit (v, true);
 
   dealii::internal::VectorOperations::Vector_copy<Number,Number2> 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<Number>::operator= (const Number s)
 
   internal::VectorOperations::Vector_set<Number> 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<Number> &Vector<Number>::operator *= (const Number factor)
 
   internal::VectorOperations::Vectorization_multiply_factor<Number> 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<Number>::add (const Number a,
   Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
 
   internal::VectorOperations::Vectorization_add_av<Number> 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<Number>::sadd (const Number x,
   Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
 
   internal::VectorOperations::Vectorization_sadd_xav<Number> 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<Number>::operator * (const Vector<Number2> &v) const
 
   Number sum;
   internal::VectorOperations::Dot<Number,Number2> 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<Number>::norm_sqr () const
 
   real_type sum;
   internal::VectorOperations::Norm2<Number,real_type> 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<Number>::mean_value () const
 
   Number sum;
   internal::VectorOperations::MeanValue<Number> 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<Number>::l1_norm () const
 
   real_type sum;
   internal::VectorOperations::Norm1<Number, real_type> 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<Number>::l2_norm () const
 
   real_type norm_square;
   internal::VectorOperations::Norm2<Number, real_type> 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<real_type>::min())
@@ -558,7 +558,7 @@ Vector<Number>::lp_norm (const real_type p) const
 
   real_type sum;
   internal::VectorOperations::NormP<Number, real_type> 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<real_type>::min())
     return std::pow(sum, static_cast<real_type>(1./p));
@@ -615,7 +615,7 @@ Vector<Number>::add_and_dot (const Number          a,
 
   Number sum;
   internal::VectorOperations::AddAndDot<Number> 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<Number> &Vector<Number>::operator -= (const Vector<Number> &v)
   Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
 
   internal::VectorOperations::Vectorization_subtract_v<Number> 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<Number>::add (const Number v)
   Assert (vec_size!=0, ExcEmptyObject());
 
   internal::VectorOperations::Vectorization_add_factor<Number> 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<Number>::add (const Vector<Number> &v)
   Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
 
   internal::VectorOperations::Vectorization_add_v<Number> 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<Number>::add (const Number a, const Vector<Number> &v,
   Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
 
   internal::VectorOperations::Vectorization_add_avpbw<Number> 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<Number>::sadd (const Number x,
   Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
 
   internal::VectorOperations::Vectorization_sadd_xv<Number> 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<Number>::sadd (const Number x, const Number a,
 
   internal::VectorOperations::Vectorization_sadd_xavbw<Number> 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<Number>::scale (const Vector<Number> &s)
   Assert (vec_size == s.vec_size, ExcDimensionMismatch(vec_size, s.vec_size));
 
   internal::VectorOperations::Vectorization_scale<Number> 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<Number>::equ (const Number a,
   Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size));
 
   internal::VectorOperations::Vectorization_equ_au<Number> 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<Number>::equ (const Number a, const Vector<Number> &u,
   Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
 
   internal::VectorOperations::Vectorization_equ_aubv<Number> 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<Number>::equ (const Number a, const Vector<Number> &u,
 
   internal::VectorOperations::Vectorization_equ_aubvcw<Number> 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<Number>::ratio (const Vector<Number> &a,
   reinit (a.size(), true);
 
   internal::VectorOperations::Vectorization_ratio<Number> 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);
 }
 
 
index 8b52d1db4109fb66e2968b3ff278bcc13dab3ea5..991e1cf1ff32994767913ba0a7425aeb8030c712 100644 (file)
@@ -159,9 +159,9 @@ namespace internal
 
     template <typename Functor>
     void parallel_for(Functor &functor,
+                      size_type start,
                       size_type end,
-                      std_cxx11::shared_ptr<parallel::internal::TBBPartitioner> &partitioner,
-                      size_type start = 0)
+                      std_cxx11::shared_ptr<parallel::internal::TBBPartitioner> &partitioner)
     {
 #ifdef DEAL_II_WITH_THREADS
       size_type vec_size = end-start;
@@ -1252,10 +1252,10 @@ namespace internal
      */
     template <typename Operation, typename ResultType>
     void parallel_reduce (const Operation   &op,
+                          const size_type    start,
                           const size_type    end,
                           ResultType        &result,
-                          std_cxx11::shared_ptr<parallel::internal::TBBPartitioner> &partitioner,
-                          const size_type start = 0)
+                          std_cxx11::shared_ptr<parallel::internal::TBBPartitioner> &partitioner)
     {
 #ifdef DEAL_II_WITH_THREADS
       size_type vec_size = end-start;
index d7965dbca46ee643a01ac527398dcac46a274e64..10cd70b62af61b4afd8f612d6a8502091a7db122 100644 (file)
@@ -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:
index 054ba9d46c8cbb8771e4639d466e5ce831697d37..e3a84e2dfa4658c28fba58782f723c6269d3db90 100644 (file)
@@ -47,7 +47,7 @@ void check ()
       internal::VectorOperations::MeanValue<Number> 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;
         }
 

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.