summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@17b73243-c579-4c4c-a9d2-2d5706c11dac>2014-05-16 18:01:49 +0000
committerrhaas <rhaas@17b73243-c579-4c4c-a9d2-2d5706c11dac>2014-05-16 18:01:49 +0000
commit14869ee49a4b66596c84d6245ee423ee094f0c3a (patch)
tree4d7c7133d97d0ff93aa7106397875f7b28d1c211
parent42a4c8721ef990c51066802d3f52613a27256b1b (diff)
recover parameters early
CCTK_RECOVER_PARAMETER is special anyway and scheduled very early (even before the thorn's startup routines are called). This patch to the flesh moves parameter recovery to just after the parameters from the parfile are processed. This ensures that anything afterwards sees the parameters from the checkpoint (for example the cache setup routine which looks at some Cactus parameters and importantly CCTKi_BindingsVariablesInitialise. git-svn-id: http://svn.cactuscode.org/flesh/trunk@5114 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--src/main/InitialiseCactus.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/src/main/InitialiseCactus.c b/src/main/InitialiseCactus.c
index 0493c4d5..792d10cf 100644
--- a/src/main/InitialiseCactus.c
+++ b/src/main/InitialiseCactus.c
@@ -31,6 +31,7 @@ CCTK_FILEVERSION(main_InitialiseCactus_c);
********************* Local Routine Prototypes *********************
********************************************************************/
static int CCTKi_InitialiseScheduler (tFleshConfig *ConfigData);
+static void CCTKi_RecoverParameters (tFleshConfig *config);
/********************************************************************
********************* Other Routine Prototypes *********************
@@ -100,6 +101,8 @@ int CCTKi_InitialiseCactus (int *argc, char ***argv, tFleshConfig *config)
CCTKi_ProcessParameterDatabase (config);
+ CCTKi_RecoverParameters (config);
+
CCTKi_SetupCache();
CCTKi_BindingsVariablesInitialise ();
@@ -170,19 +173,8 @@ static int CCTKi_InitialiseScheduler (tFleshConfig *config)
{
int retval;
const CCTK_INT *cctk_show_schedule;
- extern void CCTKi_SetParameterSetMask (int mask);
- CCTKi_SetParameterSetMask (PARAMETER_RECOVERY_IN);
-
- config->recovered = CCTKi_BindingsParameterRecoveryInitialise ();
- if (config->recovered < 0)
- {
- CCTK_Warn (0, __LINE__, __FILE__, "Cactus", "Failed to recover parameters");
- }
-
- CCTKi_SetParameterSetMask (PARAMETER_RECOVERY_POST);
-
CCTKi_BindingsScheduleInitialise ();
retval = CCTKi_DoScheduleSortAllGroups ();
@@ -201,3 +193,34 @@ static int CCTKi_InitialiseScheduler (tFleshConfig *config)
return (retval);
}
+
+ /*@@
+ @routine CCTKi_RecoverParameters
+ @date Sat May 3 18:49:25 PDT 2014
+ @author Roland Haas
+ @desc
+ Recover parameters from checkpoint
+ This needs to be called right after
+ CCTKi_ProcessParameterDatabase so that we always use the
+ parameter values from the checkpoint and never the default
+ values if the current parameter file does not set all
+ parameters.
+ @enddesc
+ @calls CCTKi_SetParameterSetMask
+ CCTKi_BindingsParameterRecoveryInitialise
+@@*/
+static void CCTKi_RecoverParameters (tFleshConfig *config)
+{
+ extern void CCTKi_SetParameterSetMask (int mask);
+
+
+ CCTKi_SetParameterSetMask (PARAMETER_RECOVERY_IN);
+
+ config->recovered = CCTKi_BindingsParameterRecoveryInitialise ();
+ if (config->recovered < 0)
+ {
+ CCTK_Warn (0, __LINE__, __FILE__, "Cactus", "Failed to recover parameters");
+ }
+
+ CCTKi_SetParameterSetMask (PARAMETER_RECOVERY_POST);
+}