mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#9887 Roff: fix freeze due combining omp and progress info.
This commit is contained in:
parent
a2cd4b0bfb
commit
261d16953a
@ -182,18 +182,6 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData
|
|||||||
size_t numActiveCells = computeActiveCellMatrixIndex( activeCells );
|
size_t numActiveCells = computeActiveCellMatrixIndex( activeCells );
|
||||||
|
|
||||||
// Loop over cells and fill them with data
|
// 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
|
#pragma omp for
|
||||||
for ( int gridLocalCellIndex = 0; gridLocalCellIndex < cellCount; ++gridLocalCellIndex )
|
for ( int gridLocalCellIndex = 0; gridLocalCellIndex < cellCount; ++gridLocalCellIndex )
|
||||||
{
|
{
|
||||||
@ -225,20 +213,6 @@ bool RifRoffFileTools::openGridFile( const QString& fileName, RigEclipseCaseData
|
|||||||
|
|
||||||
// Mark inactive long pyramid looking cells as invalid
|
// Mark inactive long pyramid looking cells as invalid
|
||||||
cell.setInvalid( cell.isLongPyramidCell() );
|
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->setGridActiveCellCounts( 0, numActiveCells );
|
activeCellInfo->setGridActiveCellCounts( 0, numActiveCells );
|
||||||
|
Loading…
Reference in New Issue
Block a user