From 51808d5ba7d38fea3072ae6f1472b06d2ef5c193 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 27 Sep 2021 08:46:37 +0200 Subject: [PATCH] #8034 Use omp for index result calculation. --- .../ReservoirDataModel/RigCaseCellResultsData.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp index 58c9cefb63..5857f71402 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCaseCellResultsData.cpp @@ -2072,9 +2072,12 @@ void RigCaseCellResultsData::computeIndexResults() } } - for ( size_t cellIdx = 0; cellIdx < m_ownerMainGrid->globalCellArray().size(); cellIdx++ ) + const std::vector& globalCellArray = m_ownerMainGrid->globalCellArray(); + long long numCells = static_cast( globalCellArray.size() ); +#pragma omp for + for ( long long cellIdx = 0; cellIdx < numCells; cellIdx++ ) { - const RigCell& cell = m_ownerMainGrid->globalCellArray()[cellIdx]; + const RigCell& cell = globalCellArray[cellIdx]; size_t resultIndex = cellIdx; if ( resultIndex == cvf::UNDEFINED_SIZE_T ) continue;