diff --git a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp index e5f6a09d11170f1710f9b309e9ec8bf55c3c3278..c4f24d992af8ee220d7efa68a0ead8fb02db5eae 100644 --- a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp +++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp @@ -16,6 +16,10 @@ #include <logog/include/logog.hpp> +#ifdef USE_PETSC +#include <mpi.h> +#endif + #include "BaseLib/FileTools.h" #include "BaseLib/RunTime.h" @@ -232,7 +236,11 @@ MeshLib::Properties NodePartitionedMeshReader::readPropertiesBinary( is.seekg(offset); boost::optional<MeshLib::IO::PropertyVectorPartitionMetaData> pvpmd( MeshLib::IO::readPropertyVectorPartitionMetaData(is)); - if (!pvpmd) + bool pvpmd_read_ok = static_cast<bool>(pvpmd); + bool all_pvpmd_read_ok; + MPI_Allreduce(&pvpmd_read_ok, &all_pvpmd_read_ok, 1, MPI_C_BOOL, MPI_LOR, + _mpi_comm); + if (!all_pvpmd_read_ok) { OGS_FATAL( "Error in NodePartitionedMeshReader::readPropertiesBinary: "