cctk.h includes cctk_Arguments.h
As of git hash 28a0e1d9 "This patch makes the CST stage create prototypes for all scheduled functions into a new file cctk_ScheduleFunctions.h, which is included into cctk.h." of cactus (about 9 years ago) cctk.h
includes via ${thorn}_Schedule.h
and the generated function prototypes for scheduled routines, the file cctk_Arguments.h
. This means that a file like this:
#include <cctk.h> void Null_Fun(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; return; }
compiles. This is somewhat surprising as the thorn writing docs http://einsteintoolkit.org/usersguide/UsersGuidech9.html#x13-85000C1.6.2 says that the file should be included.
For the most part code in the ET actually does so, though at least one file (MoL/src/MoLPreSync.cc) does not.
The prototypes are generated only for C routines where CCTK_ARGUMENTS
always ends up being cGH *cctkGH
though the route there is somewhat convoluted and involves a define (generated in GridFunStuff.pl
):
push(@data, '#define CCTK_ARGUMENTS CCTK_CARGUMENTS') push(@data, "#define CCTK_CARGUMENTS \U$thorn" . '_CARGUMENTS'); push(@returndata, "#define ${thorn}_CARGUMENTS cGH *cctkGH")
not immediately definable in cctk.h
.
To avoid exposing DECLARE_CCTK_ARGUMENTS
via cctk.h
including ${thorn}_Schedule.h
to files only including cctk.h
one may want to move ${thorn}_Schedule.h
instead into cctk_Arguments.h
which is the file one is supposed to include when using Cactus argument lists.
Comments (9)
-
reporter -
reporter - changed status to open
-
reporter Please review.
-
This all looks good to me. You might want to run the WVU thorn change past Zach.
-
reporter @Zach Etienne says (private chat message) he has merged the wvuthorns_diagnostics changes. From the looks of it this has been applied as git hash 25d9c18 "Merged in rhaas/cctkarguments (pull request
#8)" of wvuthorns_diagnostics -
reporter I am not very familiar with the development process in canuda rather than commit myself I will try and let the authors merge in https://bitbucket.org/canuda/proca/pull-requests/4/proca-include-cctk_arguments-when-using in a way they are comfortable with (later this month) and apply the flesh change afterwards (things fail to compile if I first apply the flesh change).
Unless objected I will apply https://bitbucket.org/canuda/proca/pull-requests/4/proca-include-cctk_arguments-when-using to proca after January 31st.
-
reporter -
reporter -
reporter - changed status to resolved
- Log in to comment
Pull requests are: