It would be nice if there was a function:
#include <cctk.h> const cFunctionData * CCTK_QueryScheduledFunction(const cGH * cctkGH); const cFunctionData * func = QueryScheduledFunction(cctkGH); printf("Currently running: %s::%s\n", func->thorn, func->routine);
to find the function most recently called via CCTK_CallFunction. In the simplest implementation CCTK_CallFunction() (in main/ScheduleInterface.c) would simply store its
attribute arguement in a global variable for later retrieval. A more complete implementation might have stack of called functions (in case CallFunction can be called recurively) or store the information in cctkGH (though CallFunction does not take cctkGH as an argument).
I currently have a hacked version of the first option running to find out who is calling CarpetReduce in local mode. BUt it might be useful also in eg. the interpolator calls (as in "AEILocalInterpolator: point foo out of bounds").