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;