Commit 312500be authored by franjo_j@hotmail.com's avatar franjo_j@hotmail.com
Browse files

Re-activated SMP parallelisation on Linux when the code is compiled with

gcc


git-svn-id: https://pl5.projectlocker.com/igui/meshGeneration/svn@15 fdcce57e-7e00-11e2-b579-49867b4cea03
parent 3c926c4a
#if defined(__GNUC__) && (defined(linux) || defined(linux64))
// Use SMP parallelisation with gcc on Linux machines
OMP_FLAGS = -DUSE_OMP -fopenmp
#else
OMP_FLAGS =
#endif
EXE_INC = \
$(OMP_FLAGS) \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
......
......@@ -137,7 +137,7 @@ void polyMeshGenAddressing::calcEdges() const
//- in the global list of edges
label localStart(0);
# ifdef USE_OMP
const label threadI = ompo_get_thread_num();
const label threadI = omp_get_thread_num();
# else
const label threadI = 0;
# endif
......
......@@ -718,7 +718,7 @@ void meshSurfaceEngine::calculatePointNormals() const
pointNormalsPtr_ = new vectorField(pFaces.size());
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 )
# pragma omp parallel for if( pFaces.size() > 1000 )
# endif
forAll(pFaces, pI)
{
......@@ -751,7 +751,7 @@ void meshSurfaceEngine::calculateFaceNormals() const
faceNormalsPtr_ = new vectorField(bFaces.size());
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 )
# pragma omp parallel for if( bFaces.size() > 1000 )
# endif
forAll(bFaces, bfI)
{
......@@ -769,7 +769,7 @@ void meshSurfaceEngine::calculateFaceCentres() const
faceCentresPtr_ = new vectorField(bFaces.size());
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 )
# pragma omp parallel for if( bFaces.size() > 1000 )
# endif
forAll(bFaces, bfI)
faceCentresPtr_->operator[](bfI) = bFaces[bfI].centre(points);
......
......@@ -242,7 +242,7 @@ void meshSurfaceEngineModifier::updateGeometry
boolList updateFaces(bFaces.size(), false);
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 )
# pragma omp parallel for if( updateBndNodes.size() > 1000 )
# endif
forAll(updateBndNodes, i)
{
......@@ -256,7 +256,8 @@ void meshSurfaceEngineModifier::updateGeometry
vectorField& faceCentres = *surfaceEngine_.faceCentresPtr_;
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 ) schedule(dynamic, 100)
# pragma omp parallel for if( updateFaces.size() > 1000 ) \
schedule(dynamic, 100)
# endif
forAll(updateFaces, bfI)
{
......@@ -270,7 +271,8 @@ void meshSurfaceEngineModifier::updateGeometry
vectorField& faceNormals = *surfaceEngine_.faceNormalsPtr_;
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 ) schedule(dynamic, 100)
# pragma omp parallel for if( updateFaces.size() > 1000 ) \
schedule(dynamic, 100)
# endif
forAll(updateFaces, bfI)
{
......@@ -286,7 +288,8 @@ void meshSurfaceEngineModifier::updateGeometry
vectorField& pn = *surfaceEngine_.pointNormalsPtr_;
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 ) schedule(dynamic, 100)
# pragma omp parallel for if( updateBndNodes.size() > 1000 ) \
schedule(dynamic, 100)
# endif
forAll(updateBndNodes, i)
{
......
......@@ -153,7 +153,7 @@ void meshSurfaceMapper::mapCorners(const labelListPMG& nodesToMap)
meshSurfaceEngineModifier sMod(surfaceEngine_);
# ifdef USE_OMP
# pragma omp parallel for if( size > 10 )
# pragma omp parallel for if( nodesToMap.size() > 10 )
# endif
forAll(nodesToMap, cornerI)
{
......@@ -258,7 +258,8 @@ void meshSurfaceMapper::mapEdgeNodes(const labelListPMG& nodesToMap)
//- map point to the nearest vertex on the triSurface
# ifdef USE_OMP
# pragma omp parallel for shared(parallelBndNodes) if( size > 100 )
# pragma omp parallel for shared(parallelBndNodes) \
if( nodesToMap.size() > 100 )
# endif
forAll(nodesToMap, i)
{
......
......@@ -219,6 +219,7 @@ void meshSurfaceMapper::mapVerticesOntoSurface(const labelListPMG& nodesToMap)
LongList<parMapperHelper> parallelBndNodes;
# ifdef USE_OMP
const label size = nodesToMap.size();
# pragma omp parallel for if( size > 1000 ) shared(parallelBndNodes) \
schedule(dynamic, Foam::max(1, size / (3 * omp_get_max_threads())))
# endif
......@@ -325,6 +326,7 @@ void meshSurfaceMapper::mapVerticesOntoSurfacePatches
LongList<parMapperHelper> parallelBndNodes;
# ifdef USE_OMP
const label size = nodesToMap.size();
# pragma omp parallel for if( size > 1000 ) shared(parallelBndNodes) \
schedule(dynamic, Foam::max(1, size / (3 * omp_get_max_threads())))
# endif
......
......@@ -136,7 +136,7 @@ void meshSurfaceMapper::preMapVertices(const label nIterations)
//- calculate coordinates of points for searching
# ifdef USE_OMP
# pragma omp parallel for shared(size)
# pragma omp parallel for
# endif
forAll(preMapPositions, bpI)
{
......@@ -156,7 +156,8 @@ void meshSurfaceMapper::preMapVertices(const label nIterations)
meshSurfaceEngineModifier surfaceModifier(surfaceEngine_);
# ifdef USE_OMP
# pragma omp parallel for if( size > 1000 ) shared(size) \
const label size = boundaryPoints.size();
# pragma omp parallel for if( size > 1000 ) \
schedule(dynamic, Foam::max(100, size / (3 * omp_get_max_threads())))
# endif
forAll(boundaryPoints, bpI)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment