<html>#2512: Enable detection of `attribute(pure)`
<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>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>proposal</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>minor</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Cactus</td></tr>
</table>

<p>Comment (by Roland Haas):</p>
<p>Can you provide the value fo the parameter <code>Cactus::presync_mode</code> you are using?</p>
<p>The <code>CCTKi_VarDataPriI</code> function’s “new” thing due to presync is the bit:</p>
<div class="codehilite"><pre><span></span>  if(!CCTK_HasAccess(GH,vindex))
  {
    return NULL;
  }
</pre></div>


<p>and <code>CCTK_HasAccess</code> has a short-circuit:</p>
<div class="codehilite language-c++"><pre><span></span>  <span class="k">static</span> <span class="kt">bool</span> <span class="n">presync_only</span> <span class="o">=</span> <span class="n">CCTK_Equals</span><span class="p">(</span><span class="n">presync_mode</span><span class="p">,</span> <span class="s">&quot;presync-only&quot;</span><span class="p">);</span>

  <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">presync_only</span><span class="p">)</span>
    <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
</pre></div>


<p>which returns early if the static variable indicates that the mode is not <code>presync-early</code>. So if not set then the expense would seem to be the (implicit) mutex to make the static initialization thread safe.<br />
The numbers in you table add up to 169.9% is it possible to see which function calls which other function?</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2512/enable-detection-of-attribute-pure'>https://bitbucket.org/einsteintoolkit/tickets/issues/2512/enable-detection-of-attribute-pure</a></p>
</html>