]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid setting the partitioner at the place of use
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Fri, 15 Apr 2016 13:48:56 +0000 (15:48 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 16 Apr 2016 13:31:22 +0000 (15:31 +0200)
include/deal.II/lac/vector.templates.h

index a27d46b131b67404e1ed0728553c9d587a3916dd..124587345eb4192c428869957a3ce34085135650 100644 (file)
@@ -129,8 +129,9 @@ namespace internal
     if (vec_size >= 4*internal::Vector::minimum_parallel_grain_size &&
         MultithreadInfo::n_threads() > 1)
       {
-        if (partitioner.get() == NULL)
-          partitioner.reset(new parallel::internal::TBBPartitioner());
+        Assert(partitioner.get() != NULL,
+               ExcInternalError("Unexpected initialization of Vector that does "
+                                "not set the TBB partitioner to a usable state."));
         std_cxx11::shared_ptr<tbb::affinity_partitioner> tbb_partitioner =
           partitioner->acquire_one_partitioner();
 
@@ -878,7 +879,7 @@ void Vector<Number>::reinit (const size_type n,
 
       // only reset the partitioner if we actually expect a significant vector
       // size
-      if (vec_size > 4*internal::Vector::minimum_parallel_grain_size)
+      if (vec_size >= 4*internal::Vector::minimum_parallel_grain_size)
         thread_loop_partitioner.reset(new parallel::internal::TBBPartitioner());
     }
 

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.