mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-11 16:06:04 -06:00
Avoid overflowing the progress counter in the import of Eclipse grids
This commit is contained in:
parent
752cf9925c
commit
02a2820d29
@ -133,6 +133,7 @@ bool transferGridCellData( RigMainGrid* mainGrid,
|
|||||||
|
|
||||||
int progTicks = 100;
|
int progTicks = 100;
|
||||||
int cellsPrProgressTick = std::max( 1, cellCount / progTicks );
|
int cellsPrProgressTick = std::max( 1, cellCount / progTicks );
|
||||||
|
size_t maxProgressCell = static_cast<size_t>( cellsPrProgressTick * progTicks );
|
||||||
caf::ProgressInfo progInfo( progTicks, "" );
|
caf::ProgressInfo progInfo( progTicks, "" );
|
||||||
|
|
||||||
size_t computedCellCount = 0;
|
size_t computedCellCount = 0;
|
||||||
@ -205,7 +206,8 @@ bool transferGridCellData( RigMainGrid* mainGrid,
|
|||||||
#pragma omp critical
|
#pragma omp critical
|
||||||
{
|
{
|
||||||
computedCellCount++;
|
computedCellCount++;
|
||||||
if ( computedCellCount % cellsPrProgressTick == 0 ) progInfo.incrementProgress();
|
if ( computedCellCount <= maxProgressCell && computedCellCount % cellsPrProgressTick == 0 )
|
||||||
|
progInfo.incrementProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user