From 1003bf77356d9da275af09fe6845516db329169b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 25 Apr 2023 15:07:58 +0200 Subject: [PATCH] added: explicitly check that number of processes matches .OPMRST file while the grid hash check would pick this up as well, it's better to emit an explicit error message --- .../flow/SimulatorFullyImplicitBlackoilEbos.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp index ea0624f7e..c8114b504 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp @@ -644,6 +644,17 @@ protected: const std::string groupName = "/report_step/" + std::to_string(loadStep_); reader.read(timer, groupName, "simulator_timer", HDF5File::DataSetMode::ROOT_ONLY); + std::tuple,int> header; + reader.read(header, "/", "simulator_info", HDF5File::DataSetMode::ROOT_ONLY); + const auto& [strings, procs] = header; + + if (EclGenericVanguard::comm().size() != procs) { + throw std::runtime_error("Number of processes (procs=" + + std::to_string(EclGenericVanguard::comm().size()) + + ") does not match .OPMRST file (procs=" + + std::to_string(procs) + ")"); + } + if (EclGenericVanguard::comm().size() > 1) { std::size_t stored_hash; reader.read(stored_hash, "/", "grid_checksum");