diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp index 2ba41c4799..fec68d1634 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryCaseMainCollection.cpp @@ -21,6 +21,7 @@ #include "RiaEclipseFileNameTools.h" #include "RiaEnsembleNameTools.h" #include "RiaLogging.h" +#include "RiaOpenMPTools.h" #include "RiaPreferencesSummary.h" #include "RiaPreferencesSystem.h" #include "RiaQStringFormatter.h" @@ -59,6 +60,7 @@ #include #include +#include #include CAF_PDM_SOURCE_INIT( RimSummaryCaseMainCollection, "SummaryCaseCollection" ); @@ -583,6 +585,8 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( const std::vectorsummaryDataReader() != RiaPreferencesSummary::SummaryReaderMode::HDF5_OPM_COMMON ); + std::atomic completedCount = 0; + #pragma omp parallel for schedule( dynamic ) if ( canUseMultipleThreads ) for ( int cIdx = 0; cIdx < static_cast( fileSummaryCases.size() ); ++cIdx ) { @@ -611,7 +615,14 @@ void RimSummaryCaseMainCollection::loadFileSummaryCaseData( const std::vector& progressStack_v = progressStack(); std::vector& progressSpanStack_v = progressSpanStack(); std::vector& maxProgressStack_v = maxProgressStack(); @@ -644,10 +650,12 @@ void ProgressInfoStatic::incrementProgress() if ( !isUpdatePossible() ) return; + // Ignore stale updates delivered after the owning ProgressInfo scope has ended. + if ( progressStack().empty() ) return; + std::vector& progressStack_v = progressStack(); std::vector& progressSpanStack_v = progressSpanStack(); - CAF_ASSERT( progressStack_v.size() ); ProgressInfoStatic::setProgress( progressStack_v.back() + progressSpanStack_v.back() ); } @@ -667,7 +675,9 @@ void ProgressInfoStatic::setNextProgressIncrement( size_t nextStepSize ) if ( !isUpdatePossible() ) return; - CAF_ASSERT( progressSpanStack().size() ); + // Ignore stale updates delivered after the owning ProgressInfo scope has ended. + if ( progressSpanStack().empty() ) return; + std::vector& maxProgressStack_v = maxProgressStack(); std::vector& progressStack_v = progressStack();