Performance : Move construction of AABB tree out of parallel loop

Crash seen for regression test TestCase_Surfaces
This commit is contained in:
Magne Sjaastad 2020-05-21 07:42:22 +02:00
parent b20747efbe
commit 04311c64c6

View File

@ -157,6 +157,12 @@ void RivSurfaceIntersectionGeometryGenerator::calculateArrays()
m_triVxToCellCornerWeights.reserve( nativeTriangleIndices.size() * 24 );
outputTriangleVertices.reserve( nativeTriangleIndices.size() * 24 );
// Ensure AABB search tree is constructed outside parallel loop
{
std::vector<size_t> triIntersectedCellCandidates;
m_hexGrid->findIntersectingCells( cvf::BoundingBox(), &triIntersectedCellCandidates );
}
#pragma omp parallel num_threads( 6 ) // More threads have nearly no effect
{
// Loop local memory allocation.