<html>#2317: CCTK_TraverseString with selection = CCTK_GROUP handles "all" string inconsistently
<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>Cactus_4.0.0</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</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><code>CCTK_TraverseString</code> (see its <a data-is-external-link="true" href="https://www.einsteintoolkit.org/referencemanual/ReferenceManualch2.html#x4-211000A2" rel="nofollow">docs</a>) takes a list of variable or group names and a callback function then calls a callback function once per variable in the passed in list of variables and groups.</p>
<p>Depending on whether <code>selection</code> is <code>CCTK_GROUP</code> or <code>CCTK_VAR</code> or <code>CCTK_VAR_OR_GROUP</code> the string will accept variable names, group names or either. However, in almost all cases, the callback function is called once per <em>variable</em> ie groups are expanded. The one exception is <code>selection == CCTK_GROUP</code> and <code>traverse_string == “all”</code> in which case there is special code to pass in <em>groups</em>. This code, introduced in git hash <a data-is-external-link="true" href="https://bitbucket.org/cactuscode/cactus/commits/778e8f498983e0986b1ffb73a5cc27d2d2d74588" rel="nofollow">778e8f49</a> "Fixed parsing of option string in CCTK_TraverseString()." of <a data-is-external-link="true" href="https://bitbucket.org/cactuscode/cactus" rel="nofollow">cactus</a> seems to be a bug since the previous version would have iterated over variables as well (and so does the current if one passes an actual list of groups).</p>
<p>Erik and I stumbled across this while working on CarpetX, which always outputs whole groups so uses <code>selection = CCTK_GROUP</code> while all instances in Cactus and the ET use <code>selection = CCTK_VAR_OR_GROUP</code>.</p>
<p>Pull request <a data-is-external-link="true" href="https://bitbucket.org/cactuscode/cactus/pull-requests/79/cctk_traversestring-always-return-all/diff" rel="nofollow">https://bitbucket.org/cactuscode/cactus/pull-requests/79/cctk_traversestring-always-return-all/diff</a> contains <span class="ap-mention" data-atlassian-id="557058:56049c54-f8c2-4b6c-9b88-ab697c967495">@Erik Schnetter</span> 's fix, which restores the original (well historic, given that the bug was in
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2317/cctk_traversestring-with-selection'>https://bitbucket.org/einsteintoolkit/tickets/issues/2317/cctk_traversestring-with-selection</a></p>
</html>