diff options
Diffstat (limited to 'src/Registration.c')
-rw-r--r-- | src/Registration.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/Registration.c b/src/Registration.c index 547455c..41bd70b 100644 --- a/src/Registration.c +++ b/src/Registration.c @@ -11,6 +11,7 @@ @@*/ #include "cctk.h" +#include "cctk_Arguments.h" #include "cctk_Parameters.h" #include "ExternalVariables.h" @@ -31,6 +32,8 @@ CCTK_FILEVERSION(CactusBase_MoL_Registration_c); ***************** Scheduled Routine Prototypes ********************* ********************************************************************/ +void MoL_SetScheduleStatus(CCTK_ARGUMENTS); + /******************************************************************** ********************* Other Routine Prototypes ********************* ********************************************************************/ @@ -117,6 +120,32 @@ CCTK_INT MoL_QueryEvolvedRHS(CCTK_INT EvolvedIndex); ********************************************************************/ /*@@ + @routine MoL_SetScheduleStatus + @date Mon Jan 31 16:01:51 2005 + @author Ian Hawke + @desc + Set the ScheduleStatus flag. This is to ensure that we can catch + calls to the registration routines that happen too early. + @enddesc + @calls + @calledby + @history + + @endhistory + +@@*/ + + +void MoL_SetScheduleStatus(CCTK_ARGUMENTS) +{ + + DECLARE_CCTK_ARGUMENTS; + + ScheduleStatus = 1; +} + + + /*@@ @routine MoL_RegisterEvolved @date Thu May 30 11:36:59 2002 @author Ian Hawke @@ -139,6 +168,14 @@ CCTK_INT MoL_RegisterEvolved(CCTK_INT EvolvedIndex, CCTK_INT RHSIndex) retval = 0; + if (!ScheduleStatus) + { + CCTK_WARN(0, "MoL registration routine called too early!\n" + "Please ensure that all calls to MoL registration routines " + "occur within the \"MoL_Register\" timebin."); + retval++; + } + GroupType = CCTK_GroupTypeFromVarI(EvolvedIndex); if (GroupType < 0) { @@ -249,6 +286,14 @@ CCTK_INT MoL_RegisterConstrained(CCTK_INT ConstrainedIndex) retval = 0; + if (!ScheduleStatus) + { + CCTK_WARN(0, "MoL registration routine called too early!\n" + "Please ensure that all calls to MoL registration routines " + "occur within the \"MoL_Register\" timebin."); + retval++; + } + GroupType = CCTK_GroupTypeFromVarI(ConstrainedIndex); if (GroupType < 0) { @@ -351,6 +396,14 @@ CCTK_INT MoL_RegisterSaveAndRestore(CCTK_INT SandRIndex) retval = 0; + if (!ScheduleStatus) + { + CCTK_WARN(0, "MoL registration routine called too early!\n" + "Please ensure that all calls to MoL registration routines " + "occur within the \"MoL_Register\" timebin."); + retval++; + } + GroupType = CCTK_GroupTypeFromVarI(SandRIndex); if (GroupType < 0) { @@ -439,6 +492,14 @@ CCTK_INT MoL_RegisterEvolvedGroup(CCTK_INT EvolvedGroupIndex, retval = 0; + if (!ScheduleStatus) + { + CCTK_WARN(0, "MoL registration routine called too early!\n" + "Please ensure that all calls to MoL registration routines " + "occur within the \"MoL_Register\" timebin."); + retval++; + } + GroupFirstVar = CCTK_FirstVarIndexI(EvolvedGroupIndex); if (GroupFirstVar < 0) { @@ -530,6 +591,14 @@ CCTK_INT MoL_RegisterConstrainedGroup(CCTK_INT ConstrainedGroupIndex) retval = 0; + if (!ScheduleStatus) + { + CCTK_WARN(0, "MoL registration routine called too early!\n" + "Please ensure that all calls to MoL registration routines " + "occur within the \"MoL_Register\" timebin."); + retval++; + } + GroupFirstVar = CCTK_FirstVarIndexI(ConstrainedGroupIndex); if (GroupFirstVar < 0) { @@ -616,6 +685,14 @@ CCTK_INT MoL_RegisterSaveAndRestoreGroup(CCTK_INT SandRGroupIndex) retval = 0; + if (!ScheduleStatus) + { + CCTK_WARN(0, "MoL registration routine called too early!\n" + "Please ensure that all calls to MoL registration routines " + "occur within the \"MoL_Register\" timebin."); + retval++; + } + GroupFirstVar = CCTK_FirstVarIndexI(SandRGroupIndex); if (GroupFirstVar < 0) { |