<html>#2289: CT_MultiLevel tests abort when run using more than one thread via simfactory
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</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>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>EinsteinToolkit thorn</td></tr>
</table>

<p>In git hash <a data-is-external-link="true" href="https://bitbucket.org/eloisa/ctthorns/commits/f81354537b5adb6503b4e6f264c8080a778da864" rel="nofollow">f813545</a> "CT_MultiLevel: request single-thread execution of all tests." of <a data-is-external-link="true" href="https://bitbucket.org/eloisa/ctthorns" rel="nofollow">ctthorns</a> the <code>CT_MultiLevel</code> tests were changed to force a single OpenMP thread. This is a good thing as there is a (known, harmless) race condition in the Gauss-Seidel sweep that the code uses when more than a single thread is used which renders results non-deterministic.</p>
<p>Unfortunately the change interferes badly with the sanity checks in Carpet using <code>CACTUS_NUM_THREADS</code> to check that the number of threads requested in the RunScript agrees with the number of threads that Carpet sees in use during its SetupGH routine:</p>
<div class="codehilite language-c++"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">cactus_num_threads</span> <span class="o">!=</span> <span class="n">mynthreads</span><span class="p">)</span> <span class="p">{</span>
  <span class="n">CCTK_VWarn</span><span class="p">(</span><span class="n">CCTK_WARN_ABORT</span><span class="p">,</span> <span class="n">__LINE__</span><span class="p">,</span> <span class="n">__FILE__</span><span class="p">,</span> <span class="n">CCTK_THORNSTRING</span><span class="p">,</span>
             <span class="s">&quot;The environment variable CACTUS_NUM_THREADS is set to %d, &quot;</span>
             <span class="s">&quot;but there are %d threads on this process. This may &quot;</span>
             <span class="s">&quot;indicate a severe problem with the OpenMP startup &quot;</span>
             <span class="s">&quot;mechanism.&quot;</span><span class="p">,</span>
             <span class="n">cactus_num_threads</span><span class="p">,</span> <span class="n">mynthreads</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>


<p>which uses the env variable <code>CA
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2289/ct_multilevel-tests-abort-when-run-using'>https://bitbucket.org/einsteintoolkit/tickets/issues/2289/ct_multilevel-tests-abort-when-run-using</a></p>
</html>