From f5acab44ecc6cd749dcda7458d768f55c4ff81e9 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 22 Sep 2020 11:13:06 +0200 Subject: [PATCH] Parallelise loading of ensemble curve preview data --- .../Summary/RimEnsembleCurveSet.cpp | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp index 8d36d3e44f..a46afb3442 100644 --- a/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp +++ b/ApplicationCode/ProjectDataModel/Summary/RimEnsembleCurveSet.cpp @@ -930,6 +930,8 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vector newSummaryCurves; + for ( auto& sumCase : sumCases ) { RimSummaryCurve* curve = new RimSummaryCurve(); @@ -940,12 +942,23 @@ void RimEnsembleCurveSet::updateEnsembleCurves( const std::vectorupdateCurveVisibility(); - curve->loadDataAndUpdate( false ); - curve->updateQwtPlotAxis(); - if ( curve->qwtPlotCurve() ) + newSummaryCurves.push_back( curve ); + } + +#pragma omp parallel for + for ( int i = 0; i < (int)newSummaryCurves.size(); ++i ) + { + newSummaryCurves[i]->valuesX(); + } + + for ( int i = 0; i < (int)newSummaryCurves.size(); ++i ) + { + newSummaryCurves[i]->loadDataAndUpdate( false ); + newSummaryCurves[i]->updateQwtPlotAxis(); + if ( newSummaryCurves[i]->qwtPlotCurve() ) { - curve->qwtPlotCurve()->setItemAttribute( QwtPlotItem::Legend, false ); + newSummaryCurves[i]->qwtPlotCurve()->setItemAttribute( QwtPlotItem::Legend, false ); } }