#2317: CCTK_TraverseString with selection = CCTK_GROUP handles "all" string inconsistently
Reporter:Roland Haas
Status:new
Milestone:
Version:Cactus_4.0.0
Type:bug
Priority:major
Component:Cactus

CCTK_TraverseString (see its docs) 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.

Depending on whether selection is CCTK_GROUP or CCTK_VAR or CCTK_VAR_OR_GROUP the string will accept variable names, group names or either. However, in almost all cases, the callback function is called once per variable ie groups are expanded. The one exception is selection == CCTK_GROUP and traverse_string == “all” in which case there is special code to pass in groups. This code, introduced in git hash 778e8f49 "Fixed parsing of option string in CCTK_TraverseString()." of cactus 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).

Erik and I stumbled across this while working on CarpetX, which always outputs whole groups so uses selection = CCTK_GROUP while all instances in Cactus and the ET use selection = CCTK_VAR_OR_GROUP.

Pull request https://bitbucket.org/cactuscode/cactus/pull-requests/79/cctk_traversestring-always-return-all/diff contains @Erik Schnetter 's fix, which restores the original (well historic, given that the bug was in

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2317/cctk_traversestring-with-selection