#7527 HDF Summary Reader : Add first working prototype

HDF5 must be compiled with special options to support multithreading. Disable file object multithreading for HDF5. Some vector types are not supported, as the support in opm-common reader is not complete (region, region_to_region, ...).
This commit is contained in:
Magne Sjaastad
2021-04-08 15:53:38 +02:00
parent d082ce7eb1
commit dd97e7741a
22 changed files with 990 additions and 147 deletions

View File

@@ -441,18 +441,29 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileS
RifOpmCommonEclipseSummary::resetLodCount();
#pragma omp parallel for schedule( dynamic )
RiaThreadSafeLogger threadSafeLogger;
// The HDF5 reader requires a special configuration to be thread safe. Disable threading for HDF reader creation.
bool canUseMultipleTreads =
( RiaPreferences::current()->summaryDataReader() != RiaPreferences::SummaryReaderMode::HDF5_OPM_COMMON );
#pragma omp parallel for schedule( dynamic ) if ( canUseMultipleTreads )
for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx )
{
RimFileSummaryCase* fileSummaryCase = fileSummaryCases[cIdx];
if ( fileSummaryCase )
{
fileSummaryCase->createSummaryReaderInterface();
fileSummaryCase->createSummaryReaderInterfaceThreadSafe( &threadSafeLogger );
}
progInfo.setProgress( cIdx );
}
for ( const auto& txt : threadSafeLogger.messages() )
{
RiaLogging::info( txt );
}
auto numberOfLodFilesCreated = RifOpmCommonEclipseSummary::numberOfLodFilesCreated();
if ( numberOfLodFilesCreated > 0 )
{