]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ensure all communication is finished in matrix-free loops
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 20 Oct 2020 13:02:20 +0000 (15:02 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 20 Oct 2020 13:51:37 +0000 (15:51 +0200)
include/deal.II/matrix_free/matrix_free.h
source/matrix_free/task_info.cc

index fc120c0f560f6b52e87965bbb93cdaff226b0770..66bcbd908297a03d27b967a69ebc81191ddf4e04 100644 (file)
@@ -3135,7 +3135,7 @@ namespace internal
     template <typename VectorType>
     unsigned int
     find_vector_in_mf(const VectorType &vec,
-                      const bool check_global_compatibility = false) const
+                      const bool        check_global_compatibility = true) const
     {
       unsigned int mf_component = numbers::invalid_unsigned_int;
       (void)check_global_compatibility;
@@ -3565,6 +3565,7 @@ namespace internal
         std::is_same<Number, typename VectorType::value_type>::value,
         "Type mismatch between VectorType and VectorDataExchange");
       (void)component_in_block_vector;
+
       if (vec.size() != 0)
         {
 #  ifdef DEAL_II_WITH_MPI
index c071c9dc7612ee13714ea5f4cfd6e4efc6142e40..fd892503935bd8ee2a26c3aa5744692ed86c9484 100644 (file)
@@ -353,7 +353,7 @@ namespace internal
       if (scheme != none)
         {
           funct.zero_dst_vector_range(numbers::invalid_unsigned_int);
-          if (scheme == partition_partition)
+          if (scheme == partition_partition && evens > 0)
             {
               tbb::empty_task *root =
                 new (tbb::task::allocate_root()) tbb::empty_task;
@@ -413,6 +413,14 @@ namespace internal
               root->wait_for_all();
               root->destroy(*root);
             }
+          else if (scheme == partition_partition)
+            {
+              // catch the case of empty partition list: we still need to call
+              // the vector communication routines to clean up and initiate
+              // things
+              funct.vector_update_ghosts_finish();
+              funct.vector_compress_start();
+            }
           else // end of partition-partition, start of partition-color
             {
               // check whether there is only one partition. if not, build up the

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.