Merge pull request #5073 from OPM/progress-bar

Progress bar to summary reader
This commit is contained in:
Magne Sjaastad 2019-11-21 07:10:32 +01:00
parent 72a5c6cfef
commit a511f580e4

View File

@ -401,7 +401,9 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileS
// RimSummaryCase, as it is difficult to make sure all variants of the leaf classes are thread safe. // RimSummaryCase, as it is difficult to make sure all variants of the leaf classes are thread safe.
// Only open the summary file reader in parallel loop to reduce risk of multi threading issues // Only open the summary file reader in parallel loop to reduce risk of multi threading issues
#pragma omp parallel for caf::ProgressInfo progInfo( fileSummaryCases.size(), "Loading Summary Cases" );
#pragma omp parallel for schedule( dynamic )
for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx ) for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx )
{ {
RimFileSummaryCase* fileSummaryCase = fileSummaryCases[cIdx]; RimFileSummaryCase* fileSummaryCase = fileSummaryCases[cIdx];
@ -409,6 +411,8 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileS
{ {
fileSummaryCase->createSummaryReaderInterface(); fileSummaryCase->createSummaryReaderInterface();
} }
progInfo.setProgress( cIdx );
} }
for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx ) for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx )