]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid setting face vectorization boundary in serial 15229/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Tue, 16 May 2023 12:04:24 +0000 (14:04 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Fri, 19 May 2023 08:20:24 +0000 (10:20 +0200)
include/deal.II/matrix_free/matrix_free.templates.h

index 716265595192d6359d81c33693015f0214ac3806..4f6614450677ea9f53c99c1a3a9e99bc04fae45a 100644 (file)
@@ -1951,14 +1951,23 @@ MatrixFree<dim, Number, VectorizedArrayType>::initialize_indices(
 
       std::vector<bool> hard_vectorization_boundary(
         task_info.face_partition_data.size(), false);
-      if (task_info.scheme == internal::MatrixFreeFunctions::TaskInfo::none &&
-          task_info.partition_row_index[2] <
-            task_info.face_partition_data.size())
-        hard_vectorization_boundary[task_info.partition_row_index[2]] = true;
+      if (task_info.scheme == internal::MatrixFreeFunctions::TaskInfo::none)
+        {
+          // In case we do an MPI data exchange, we must make sure to first
+          // complete all face integrals with results in the ghost range
+          if (task_info.partition_row_index[2] <
+              task_info.face_partition_data.size())
+            hard_vectorization_boundary[task_info.partition_row_index[2]] =
+              true;
+        }
       else
-        std::fill(hard_vectorization_boundary.begin(),
-                  hard_vectorization_boundary.end(),
-                  true);
+        {
+          // If we do threading, we need to strictly adhere to each partition,
+          // as we can't schedule work on conflicting face batches
+          std::fill(hard_vectorization_boundary.begin(),
+                    hard_vectorization_boundary.end(),
+                    true);
+        }
 
       internal::MatrixFreeFunctions::collect_faces_vectorization(
         face_setup.inner_faces,

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.