diff --git a/ApplicationLibCode/FileInterface/RifRoffFileTools.cpp b/ApplicationLibCode/FileInterface/RifRoffFileTools.cpp index b64f93f77a..120bbea416 100644 --- a/ApplicationLibCode/FileInterface/RifRoffFileTools.cpp +++ b/ApplicationLibCode/FileInterface/RifRoffFileTools.cpp @@ -182,63 +182,37 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData size_t numActiveCells = computeActiveCellMatrixIndex( activeCells ); // Loop over cells and fill them with data -#pragma omp parallel - { - int cellCountPerThread = cellCount; -#ifdef USE_OPENMP - cellCountPerThread = std::max( 1, cellCount / omp_get_num_threads() ); -#endif - - int computedThreadCellCount = 0; - - int cellsPrProgressTick = std::max( 1, cellCountPerThread / progTicks ); - int maxProgressCell = cellsPrProgressTick * progTicks; - #pragma omp for - for ( int gridLocalCellIndex = 0; gridLocalCellIndex < cellCount; ++gridLocalCellIndex ) + for ( int gridLocalCellIndex = 0; gridLocalCellIndex < cellCount; ++gridLocalCellIndex ) + { + RigCell& cell = mainGrid->globalCellArray()[cellStartIndex + gridLocalCellIndex]; + + cell.setGridLocalCellIndex( gridLocalCellIndex ); + + // Active cell index + int matrixActiveIndex = activeCells[gridLocalCellIndex]; + if ( matrixActiveIndex != -1 ) { - RigCell& cell = mainGrid->globalCellArray()[cellStartIndex + gridLocalCellIndex]; - - cell.setGridLocalCellIndex( gridLocalCellIndex ); - - // Active cell index - int matrixActiveIndex = activeCells[gridLocalCellIndex]; - if ( matrixActiveIndex != -1 ) - { - activeCellInfo->setCellResultIndex( cellStartIndex + gridLocalCellIndex, matrixActiveIndex ); - } - - cell.setParentCellIndex( cvf::UNDEFINED_SIZE_T ); - - // Corner coordinates - for ( int cIdx = 0; cIdx < 8; ++cIdx ) - { - double* point = mainGrid->nodes()[nodeStartIndex + (size_t)gridLocalCellIndex * 8 + cellMappingECLRi[cIdx]].ptr(); - auto corner = getCorner( *mainGrid, cornerLines, zCorners, gridLocalCellIndex, cIdx, offset, scale ); - - point[0] = corner.x(); - point[1] = corner.y(); - point[2] = corner.z(); - - cell.cornerIndices()[cIdx] = nodeStartIndex + (size_t)gridLocalCellIndex * 8 + cIdx; - } - - // Mark inactive long pyramid looking cells as invalid - cell.setInvalid( cell.isLongPyramidCell() ); - -#ifdef USE_OPENMP - if ( omp_get_thread_num() == 0 ) - { - computedThreadCellCount++; - if ( computedThreadCellCount <= maxProgressCell && computedThreadCellCount % cellsPrProgressTick == 0 ) - progInfo.incrementProgress(); - } -#else - computedThreadCellCount++; - if ( computedThreadCellCount <= maxProgressCell && computedThreadCellCount % cellsPrProgressTick == 0 ) - progInfo.incrementProgress(); -#endif + activeCellInfo->setCellResultIndex( cellStartIndex + gridLocalCellIndex, matrixActiveIndex ); } + + cell.setParentCellIndex( cvf::UNDEFINED_SIZE_T ); + + // Corner coordinates + for ( int cIdx = 0; cIdx < 8; ++cIdx ) + { + double* point = mainGrid->nodes()[nodeStartIndex + (size_t)gridLocalCellIndex * 8 + cellMappingECLRi[cIdx]].ptr(); + auto corner = getCorner( *mainGrid, cornerLines, zCorners, gridLocalCellIndex, cIdx, offset, scale ); + + point[0] = corner.x(); + point[1] = corner.y(); + point[2] = corner.z(); + + cell.cornerIndices()[cIdx] = nodeStartIndex + (size_t)gridLocalCellIndex * 8 + cIdx; + } + + // Mark inactive long pyramid looking cells as invalid + cell.setInvalid( cell.isLongPyramidCell() ); } activeCellInfo->setGridActiveCellCounts( 0, numActiveCells );