From: Matthias Maier Date: Fri, 5 Jul 2024 23:02:20 +0000 (-0500) Subject: distributed::Triangulation: broadcast proper p4est checksum over all ranks X-Git-Tag: v9.6.0-rc1~125^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=893a8f8766c07a6967152b380b4867faa6ee9499;p=dealii.git distributed::Triangulation: broadcast proper p4est checksum over all ranks --- 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; }