mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-11 08:51:55 -06:00
added: store a hash of the grid cell mapping on each process
this is a simple sanity check to make sure the restarted run has the same grid partitioning as the original run.
This commit is contained in:
parent
8c3400f562
commit
c50fcc5818
@ -22,6 +22,8 @@
|
|||||||
#ifndef OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
#ifndef OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
||||||
#define OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
#define OPM_SIMULATORFULLYIMPLICITBLACKOILEBOS_HEADER_INCLUDED
|
||||||
|
|
||||||
|
#include <dune/common/hash.hh>
|
||||||
|
|
||||||
#include <opm/simulators/flow/BlackoilModelEbos.hpp>
|
#include <opm/simulators/flow/BlackoilModelEbos.hpp>
|
||||||
#include <opm/simulators/flow/BlackoilModelParametersEbos.hpp>
|
#include <opm/simulators/flow/BlackoilModelParametersEbos.hpp>
|
||||||
#include <opm/simulators/flow/ConvergenceOutputConfiguration.hpp>
|
#include <opm/simulators/flow/ConvergenceOutputConfiguration.hpp>
|
||||||
@ -593,6 +595,12 @@ protected:
|
|||||||
ebosSimulator_.vanguard().caseName(),
|
ebosSimulator_.vanguard().caseName(),
|
||||||
str.str(),
|
str.str(),
|
||||||
EclGenericVanguard::comm().size());
|
EclGenericVanguard::comm().size());
|
||||||
|
|
||||||
|
if (EclGenericVanguard::comm().size() > 1) {
|
||||||
|
const auto& cellMapping = ebosSimulator_.vanguard().globalCell();
|
||||||
|
std::size_t hash = Dune::hash_range(cellMapping.begin(), cellMapping.end());
|
||||||
|
writer.write(hash, "/", "grid_checksum");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
writer.write(*this, groupName, "simulator_data");
|
writer.write(*this, groupName, "simulator_data");
|
||||||
writer.write(timer, groupName, "simulator_timer",
|
writer.write(timer, groupName, "simulator_timer",
|
||||||
@ -626,6 +634,16 @@ protected:
|
|||||||
const std::string groupName = "/report_step/" + std::to_string(loadStep_);
|
const std::string groupName = "/report_step/" + std::to_string(loadStep_);
|
||||||
reader.read(timer, groupName, "simulator_timer", HDF5File::DataSetMode::ROOT_ONLY);
|
reader.read(timer, groupName, "simulator_timer", HDF5File::DataSetMode::ROOT_ONLY);
|
||||||
|
|
||||||
|
if (EclGenericVanguard::comm().size() > 1) {
|
||||||
|
std::size_t stored_hash;
|
||||||
|
reader.read(stored_hash, "/", "grid_checksum");
|
||||||
|
const auto& cellMapping = ebosSimulator_.vanguard().globalCell();
|
||||||
|
std::size_t hash = Dune::hash_range(cellMapping.begin(), cellMapping.end());
|
||||||
|
if (hash != stored_hash) {
|
||||||
|
throw std::runtime_error("Grid hash mismatch, .SAVE file cannot be used");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OPM_END_PARALLEL_TRY_CATCH("Error loading serialized state: ",
|
OPM_END_PARALLEL_TRY_CATCH("Error loading serialized state: ",
|
||||||
EclGenericVanguard::comm());
|
EclGenericVanguard::comm());
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user