- removed comment
CCTK_ImpFromVarI sometimes returns the thorn name
I added the following debug code to one of my routines
int n = CCTK_NumVars();
for(int v=0; v < n; ++v) {
void *data = CCTK_VarDataPtrI(cctkGH,0,v);
if(data == 0) continue;
std::string imp = CCTK_ImpFromVarI(v);
std::cout << "DEBUG: " << imp << "::" << CCTK_VarName(v) << std::endl;
}
I get the following correct output from CartGrid3D DEBUG: GRID::x DEBUG: GRID::y DEBUG: GRID::z DEBUG: GRID::r
However, I see this output from CarpetReduce DEBUG: CARPETREDUCE::weight DEBUG: CARPETREDUCE::excised_cells
And I expected to see "REDUCE::weight"
Keyword:
Comments (6)
-
-
- removed comment
Manual updates are always welcome.
-
- removed comment
Replying to [comment:2 rhaas]:
Manual updates are always welcome.
Of course. My question was more towards the idea of the function. From the name I would assume I do get the implementation, always, which doesn't seem to be the case. We could just add a note to the docu and go on, of course.
-
- removed comment
I think we should just add a note to the docu and go on. The point of the flesh code seems to be that there really is no "implementation" for a private variable since other thorns providing the same implementation would not necessarily have to posses the same private variable but have to possess the same public variables.
Just to say both yes and no: this is not the first time that users were confused about "implementation" vs "thorn" for private variables or parameters.
-
reporter - changed status to resolved
- removed comment
The documentation has been updated.
-
- changed status to closed
- edited description
- Log in to comment
In the code I see:
In short: for private variable groups, the implementation name is set to be the thorn name. This looks odd, but seems to be intentional.
It can also be found in the manual: The group name should be the given in its fully qualified form, that is \code{<implementation>::<group>} for a public or protected group, and \code{<thornname>::<group>} for a private group.
It probably should be mentioned in the docu for CCTK_ImpFromVarI as well. Anyone disagrees?