mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3634 Regression Test : Use flag to control OpenMP when building geometry
This commit is contained in:
@@ -172,8 +172,9 @@ bool CellRangeFilter::hasIncludeRanges() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
StructGridGeometryGenerator::StructGridGeometryGenerator(const StructGridInterface* grid)
|
||||
: m_grid(grid)
|
||||
StructGridGeometryGenerator::StructGridGeometryGenerator(const StructGridInterface* grid, bool useOpenMP)
|
||||
: m_grid(grid),
|
||||
m_useOpenMP(useOpenMP)
|
||||
{
|
||||
CVF_ASSERT(grid);
|
||||
m_quadMapper = new StructGridQuadToCellFaceMapper;
|
||||
@@ -373,7 +374,7 @@ void StructGridGeometryGenerator::computeArrays()
|
||||
|
||||
cvf::Vec3d offset = m_grid->displayModelOffset();
|
||||
|
||||
#pragma omp parallel for schedule(dynamic)
|
||||
#pragma omp parallel for schedule(dynamic) if (m_useOpenMP)
|
||||
for (int k = 0; k < static_cast<int>(m_grid->cellCountK()); k++)
|
||||
{
|
||||
size_t j;
|
||||
|
||||
@@ -164,7 +164,7 @@ private:
|
||||
class StructGridGeometryGenerator : public Object
|
||||
{
|
||||
public:
|
||||
explicit StructGridGeometryGenerator(const StructGridInterface* grid);
|
||||
explicit StructGridGeometryGenerator(const StructGridInterface* grid, bool useOpenMP);
|
||||
~StructGridGeometryGenerator();
|
||||
|
||||
// Setup methods
|
||||
@@ -209,6 +209,11 @@ private:
|
||||
// Mappings
|
||||
ref<StructGridQuadToCellFaceMapper> m_quadMapper;
|
||||
ref<StuctGridTriangleToCellFaceMapper> m_triangleMapper;
|
||||
|
||||
// Multiple treads can be used when building geometry data structures.
|
||||
// This causes visual artifacts due to transparency algorithm, and a stable visual image
|
||||
// can be produced if OpenMP is disabled. Currently used by regression test comparing images
|
||||
bool m_useOpenMP;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user