ParallelRestart: add method for loading only solution from restart

This commit is contained in:
Arne Morten Kvarving committed 2025-03-31 08:18:39 +02:00
1 parent 9512ff1d2d
commit 970754ef91
2 files changed
+29

No files matched your search

+23
View File
@@ -58,4 +58,27 @@ RestartValue loadParallelRestart(const EclipseIO* eclIO,
#endif
}
data::Solution loadParallelRestartSolution(const EclipseIO* eclIO,
const std::vector<Opm::RestartKey>& solutionKeys,
[[maybe_unused]] Parallel::Communication comm,
const int step)
{
#if HAVE_MPI
data::Solution sol{};
if (eclIO)
{
assert(comm.rank() == 0);
sol = eclIO->loadRestartSolution(solutionKeys, step);
}
Parallel::MpiSerializer ser(comm);
ser.broadcast(0, sol);
return sol;
#else
return eclIO->loadRestartSolution(solutionKeys, step);
#endif
}
} // end namespace Opm
+6
View File
@@ -26,6 +26,7 @@
namespace Opm {
class EclipseIO;
namespace data { class Solution; }
class SummaryState;
class RestartKey;
class RestartValue;
@@ -42,6 +43,11 @@ RestartValue loadParallelRestart(const EclipseIO* eclIO,
const std::vector<RestartKey>& extraKeys,
Parallel::Communication comm);
data::Solution loadParallelRestartSolution(const EclipseIO* eclIO,
const std::vector<RestartKey>& solutionKeys,
Parallel::Communication comm,
const int step);
} // end namespace Opm
#endif // PARALLEL_RESTART_HPP