Skip to content
Snippets Groups Projects
Commit 528c8f5c authored by Mark OLESEN's avatar Mark OLESEN
Browse files

COMP: define 'USE_OMP' independently from wmake rules

- the wmake rules will be slimmed down in the future
parent 08832a0f
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,11 @@ ifeq (,$(strip $(FOAM_MODULE_LIBBIN))) ...@@ -5,6 +5,11 @@ ifeq (,$(strip $(FOAM_MODULE_LIBBIN)))
FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN) FOAM_MODULE_LIBBIN = $(FOAM_USER_LIBBIN)
endif endif
/* Define USE_OMP if -fopenmp (-qopenmp etc) found */
ifneq (,$(findstring openmp,$(COMP_OPENMP)))
COMP_OPENMP += -DUSE_OMP
endif
EXE_INC = \ EXE_INC = \
$(COMP_OPENMP) \ $(COMP_OPENMP) \
-I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \
......
...@@ -66,9 +66,7 @@ int main(int argc, char *argv[]) ...@@ -66,9 +66,7 @@ int main(int argc, char *argv[])
// scale the points // scale the points
pointFieldPMG& pts = pmg.points(); pointFieldPMG& pts = pmg.points();
# ifdef USE_OMP #pragma omp parallel for schedule(dynamic, 100)
# pragma omp parallel for schedule(dynamic, 100)
# endif
forAll(pts, pointI) forAll(pts, pointI)
{ {
pts[pointI] *= scalingFactor; pts[pointI] *= scalingFactor;
......
...@@ -67,11 +67,11 @@ int main(int argc, char *argv[]) ...@@ -67,11 +67,11 @@ int main(int argc, char *argv[])
pointField& pts = sMod.pointsAccess(); pointField& pts = sMod.pointsAccess();
// scales the vertices // scales the vertices
# ifdef USE_OMP #pragma omp parallel for schedule(dynamic, 100)
# pragma omp parallel for schedule(dynamic, 100)
# endif
forAll(pts, pointI) forAll(pts, pointI)
{
pts[pointI] *= scalingFactor; pts[pointI] *= scalingFactor;
}
// write the mesh back on disk // write the mesh back on disk
surface.writeSurface(outFileName); surface.writeSurface(outFileName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment