]> https://gitweb.dealii.org/ - dealii.git/commitdiff
distributed::Triangulation: broadcast proper p4est checksum over all ranks
authorMatthias Maier <tamiko@43-1.org>
Fri, 5 Jul 2024 23:02:20 +0000 (18:02 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 7 Jul 2024 04:16:03 +0000 (23:16 -0500)
source/distributed/tria.cc

index 6f87521425724a0e977d54d3de22f312e580e1a7..9063b2253c98488e0c782aead13da26248d564e6 100644 (file)
@@ -2274,7 +2274,22 @@ namespace parallel
       Assert(parallel_forest != nullptr,
              ExcMessage(
                "Can't produce a check sum when no forest is created yet."));
-      return dealii::internal::p4est::functions<dim>::checksum(parallel_forest);
+
+      auto checksum =
+        dealii::internal::p4est::functions<dim>::checksum(parallel_forest);
+
+#  if !DEAL_II_P4EST_VERSION_GTE(2, 8, 6, 0)
+      /*
+       * p4est prior to 2.8.6 returns the proper checksum only on rank 0
+       * and simply "0" on all other ranks. This is not really what we
+       * want, thus broadcast the correct value to all other ranks:
+       */
+      checksum = Utilities::MPI::broadcast(this->mpi_communicator,
+                                           checksum,
+                                           /*root_process*/ 0);
+#  endif
+
+      return checksum;
     }
 
 

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.