mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#14596 Remove unnecessary critical section in RiaCurveMerger
Each iteration writes to its own element of accumulatedValidValues, which is sized before the loop, so no synchronization is required. The write to curveValues a few lines below uses the same pattern without a critical section. All unnamed critical regions share a single process wide lock, so this also removes contention against unrelated parallel loops.
This commit is contained in:
@@ -195,7 +195,7 @@ void RiaCurveMerger<XValueType>::computeInterpolatedValues( bool includeValuesFr
|
||||
|
||||
if ( !RiaCurveDataTools::isValidValue( interpolValue, false ) )
|
||||
{
|
||||
#pragma omp critical
|
||||
// Each iteration writes to its own element, so no synchronization is required
|
||||
accumulatedValidValues[valueIndex] = HUGE_VAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user