Use opm-common to read restart file from summary file

Testing identified performance issues related to reading restart file name from summary files.

Make sure the reading of timesteps is done only when required in new function getFileInfoAndTimeSteps.

Add reading of restart file name using opm-common when opm-common is active. The performance of this reader is much better than resdata.
This commit is contained in:
Magne Sjaastad
2024-11-14 11:55:02 +01:00
parent acbf0ef15a
commit 664b082c81
7 changed files with 188 additions and 61 deletions

View File

@@ -167,16 +167,24 @@ RifSummaryReaderInterface* RimFileSummaryCase::findRelatedFilesAndCreateReader(
{
if ( lookForRestartFiles )
{
std::vector<QString> warnings;
std::vector<RifRestartFileInfo> restartFileInfos = RifEclipseSummaryTools::getRestartFiles( headerFileName, warnings );
std::vector<QString> warnings;
std::vector<QString> restartFileNames;
if ( RiaPreferencesSummary::current()->summaryDataReader() == RiaPreferencesSummary::SummaryReaderMode::OPM_COMMON )
{
restartFileNames = RifEclipseSummaryTools::getRestartFileNamesOpm( headerFileName, warnings );
}
else
{
restartFileNames = RifEclipseSummaryTools::getRestartFileNames( headerFileName, warnings );
}
if ( !restartFileInfos.empty() )
if ( !restartFileNames.empty() )
{
std::vector<std::string> summaryFileNames;
summaryFileNames.push_back( headerFileName.toStdString() );
for ( const auto& s : restartFileInfos )
for ( const auto& fileName : restartFileNames )
{
summaryFileNames.push_back( s.fileName.toStdString() );
summaryFileNames.push_back( fileName.toStdString() );
}
// The ordering in intended to be start of history first, so we reverse the ordering