mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-16 10:22:15 -05:00
Add ifdefs for OpenMP usage.
This commit is contained in:
1 parent
81a93a80fd
commit
02944f4eca
4 files changed
+33
-5
No files matched your search
@@ -44,7 +44,10 @@
|
||||
#include "cvfStructGridGeometryGenerator.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef USE_OPENMP
|
||||
#include <omp.h>
|
||||
#endif
|
||||
|
||||
namespace caf
|
||||
{
|
||||
@@ -857,11 +860,20 @@ void RimContourMapProjection::generateTrianglesWithVertexValues()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USE_OPENMP
|
||||
std::vector<std::vector<std::vector<cvf::Vec4d>>> threadTriangles( omp_get_max_threads() );
|
||||
#else
|
||||
std::vector<std::vector<std::vector<cvf::Vec4d>>> threadTriangles( 1 );
|
||||
#endif
|
||||
|
||||
#pragma omp parallel
|
||||
{
|
||||
#ifdef USE_OPENMP
|
||||
int myThread = omp_get_thread_num();
|
||||
#else
|
||||
int myThread = 0;
|
||||
#endif
|
||||
threadTriangles[myThread].resize( std::max( (size_t)1, m_contourPolygons.size() ) );
|
||||
|
||||
#pragma omp for schedule( dynamic )
|
||||
|
||||
Reference in new issue
Block a user