diff --git a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp index 1518540c6a..2f6c3a4a70 100644 --- a/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmCommonSummary.cpp @@ -79,7 +79,7 @@ void RifOpmCommonEclipseSummary::setEnsembleImportState( RifEnsembleImportConfig void RifOpmCommonEclipseSummary::resetEnhancedSummaryFileCount() { // This function can be called from a parallel loop, make it thread safe -#pragma omp critical +#pragma omp critical( critical_section_createdEsmryFileCount ) sm_createdEsmryFileCount = 0; } @@ -405,6 +405,6 @@ std::string RifOpmCommonEclipseSummary::keywordForAddress( const RifEclipseSumma void RifOpmCommonEclipseSummary::increaseEsmryFileCount() { // This function can be called from a parallel loop, make it thread safe -#pragma omp critical +#pragma omp critical( critical_section_createdEsmryFileCount ) sm_createdEsmryFileCount++; } diff --git a/ApplicationLibCode/FileInterface/RifOpmSummaryTools.cpp b/ApplicationLibCode/FileInterface/RifOpmSummaryTools.cpp index 0abf0c69fa..5aac060a73 100644 --- a/ApplicationLibCode/FileInterface/RifOpmSummaryTools.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmSummaryTools.cpp @@ -107,7 +107,7 @@ std::pair, std::map cornerWeights2 = caf::HexInterpolator::vertexWeights( cellCorners, clippedTriangleVxes[triVxIdx + 2] ); -#pragma omp critical +#pragma omp critical( critical_section_RivSurfaceIntersectionGeometryGenerator_computeArrays ) { outputTriangleVertices.emplace_back( point0 ); outputTriangleVertices.emplace_back( point1 ); diff --git a/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapTrianglesGenerator.cpp b/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapTrianglesGenerator.cpp index 230ba8fc52..cfff084a49 100644 --- a/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapTrianglesGenerator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/ContourMap/RigContourMapTrianglesGenerator.cpp @@ -219,7 +219,7 @@ std::vector // Add critical section here due to a weird bug when running in a single thread // Running multi threaded does not require this critical section, as we use a thread local data // structure -#pragma omp critical +#pragma omp critical( critical_section_RigContourMapTrianglesGenerator_threadTriangles ) threadTriangles[myThread][c].insert( threadTriangles[myThread][c].end(), clippedTriangles.begin(), clippedTriangles.end() ); diff --git a/ApplicationLibCode/ReservoirDataModel/RigCellFaceGeometryTools.cpp b/ApplicationLibCode/ReservoirDataModel/RigCellFaceGeometryTools.cpp index a4ef1b35b1..ec84d63148 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigCellFaceGeometryTools.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigCellFaceGeometryTools.cpp @@ -115,7 +115,7 @@ cvf::StructGridInterface::FaceType RigCellFaceGeometryTools::calculateCellFaceOv void assignThreadConnections( RigConnectionContainer& allConnections, RigConnectionContainer& threadConnections ) { -#pragma omp critical +#pragma omp critical( critical_section_RigCellFaceGeometryTools_assignThreadConnections ) { allConnections.push_back( threadConnections ); } diff --git a/ApplicationLibCode/ReservoirDataModel/RigMainGrid.cpp b/ApplicationLibCode/ReservoirDataModel/RigMainGrid.cpp index a07f75875e..1dd95f9224 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigMainGrid.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigMainGrid.cpp @@ -989,7 +989,7 @@ void RigMainGrid::buildCellSearchTree() const threadIndicesForBoundingBoxes.shrink_to_fit(); threadBoundingBoxes.shrink_to_fit(); -#pragma omp critical +#pragma omp critical( critical_section_RigMainGrid_buildCellSearchTree ) { cellIndicesForBoundingBoxes.insert( cellIndicesForBoundingBoxes.end(), threadIndicesForBoundingBoxes.begin(), diff --git a/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp b/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp index 9bee5e5bcd..c1fe30472d 100644 --- a/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp @@ -496,7 +496,7 @@ bool AABBTree::buildTree() { bThreadRes = bThreadRes && buildTree(m_previousLevelNodes[i].node, m_previousLevelNodes[i].fromIdx, m_previousLevelNodes[i].toIdx, 4); } -#pragma omp critical +#pragma omp critical(critical_section_BoundingBoxTree_buildTree) { bRes = bRes && bThreadRes; } @@ -860,7 +860,7 @@ cvf::BoundingBox BoundingBoxTreeImpl::createLeaves() m_ppLeaves[i] = leaf; threadBox.addValid(m_validBoundingBoxes[i]); } -#pragma omp critical +#pragma omp critical(critical_section_BoundingBoxTree_createLeaves) { box.addValid(threadBox); }