<html>#2444: Make it possible to disable OpenMP in the `cctk_Loop.h` loop macros
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Erik Schnetter</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>enhancement</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Comment (by Roland Haas):</p>
<p>Somewhat ugly, but seems to be the only solution.</p>
<p>Naming scheme (OMP or OPENMP) is consistent with the existing <code>CCTK_DISABLE_OMP_COLLAPSE</code> configure option.</p>
<p>I would suggest to extend the ifndef to include also the case where _OPENMP is not defined (ie </p>
<ul>
<li>fopenmp</li>
</ul>
<p>is not in effect):</p>
<div class="codehilite"><pre><span></span>#  if(defined(_OPENMP) &amp;&amp; !defined(CCTK_LOOP_DISABLE_OMP))
#    define CCTK_PRAGMA_OMP(x) _Pragma(x)
#  else
#    define CCTK_PRAGMA_OMP(x)
#  endif
</pre></div>


<p>since this will avoid the “warning: ignoring #pragma omp for” warnings when compiling without </p>
<ul>
<li>fopenmp</li>
</ul>
<p>. It does require, like all such checks for OPENMP, that </p>
<ul>
<li>fopenmp</li>
</ul>
<p>is part of <code>FPPFLAGS</code> and <code>CPPFLAGS</code> (required already for MAKEDEPEND to work which uses <code>CPP</code> and <code>FPP</code> only) so runs slight risk of always disabling OpenMP in <code>CCTK_LOOP</code> if <code>CPPFLAGS</code> and <code>FPPFLAGS</code> are not set correctly (know-architectures does not set them, unfortunately).</p>
<p>Other than that please apply.</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2444/make-it-possible-to-disable-openmp-in-the'>https://bitbucket.org/einsteintoolkit/tickets/issues/2444/make-it-possible-to-disable-openmp-in-the</a></p>
</html>