#2444: Make it possible to disable OpenMP in the `cctk_Loop.h` loop macros
| Reporter: | Erik Schnetter |
| Status: | new |
| Milestone: | |
| Version: | |
| Type: | enhancement |
| Priority: | major |
| Component: | Cactus |
Comment (by Roland Haas):
Somewhat ugly, but seems to be the only solution.
Naming scheme (OMP or OPENMP) is consistent with the existing CCTK_DISABLE_OMP_COLLAPSE configure option.
I would suggest to extend the ifndef to include also the case where _OPENMP is not defined (ie
is not in effect):
# if(defined(_OPENMP) && !defined(CCTK_LOOP_DISABLE_OMP)) # define CCTK_PRAGMA_OMP(x) _Pragma(x) # else # define CCTK_PRAGMA_OMP(x) # endif
since this will avoid the “warning: ignoring #pragma omp for” warnings when compiling without
. It does require, like all such checks for OPENMP, that
is part of FPPFLAGS and CPPFLAGS (required already for MAKEDEPEND to work which uses CPP and FPP only) so runs slight risk of always disabling OpenMP in CCTK_LOOP if CPPFLAGS and FPPFLAGS are not set correctly (know-architectures does not set them, unfortunately).
Other than that please apply.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2444/make-it-possible-to-disable-openmp-in-the