From 893a8f8766c07a6967152b380b4867faa6ee9499 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Fri, 5 Jul 2024 18:02:20 -0500 Subject: [PATCH] distributed::Triangulation: broadcast proper p4est checksum over all ranks --- source/distributed/tria.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 6f87521425..9063b2253c 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -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::checksum(parallel_forest); + + auto checksum = + dealii::internal::p4est::functions::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; } -- 2.39.5