diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-02-03 10:50:34 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2006-02-03 10:50:34 +0000 |
commit | a9205587edf38dec411bd5ab0248f8854e733cc1 (patch) | |
tree | e99d9d437a0552acecc4da29986f37533c62fa3f /src/main | |
parent | 97c7583a681ed33c92b5840334b55ef59cf8b305 (diff) |
When recovering parameters from checkpoint, only warn about attempts to set
a non-steerable parameter if its value in the recovery parfile differs from
the one in the checkpoint.
This avoids unnecessary warnings when recovering with the same parfile (and
IO::recovery = "autoprobe" set).
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4249 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/Parameters.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/main/Parameters.c b/src/main/Parameters.c index 9b4bf289..ef7069b3 100644 --- a/src/main/Parameters.c +++ b/src/main/Parameters.c @@ -539,6 +539,8 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *value) if (param) { + old_value = CCTK_ParameterValString (param->props->name, + param->props->thorn); if(param->array) { @@ -550,8 +552,8 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *value) else if(param->props->accumulator_expression) { CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", - "CCTK_ParameterSet: Cannot set accumulator parameter '%s::%s' directly" - , thorn, name); + "CCTK_ParameterSet: Cannot set accumulator parameter '%s::%s'" + " directly", thorn, name); retval = -7; } /* before parameter recovery (which is while parsing the parameter file) @@ -572,12 +574,15 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *value) from the parameter file are overwritten by the checkpoint file */ if (param->props->steerable == CCTK_STEERABLE_NEVER) { - CCTK_VWarn (2, __LINE__, __FILE__, "Cactus", - "CCTK_ParameterSet: Non-steerable parameter '%s::%s' is " - "not set from the parameter file but recovered from the " - "checkpoint file", - thorn, name); - retval = ParameterSet (param, value); + if (strcmp (old_value, value)) + { + CCTK_VWarn (2, __LINE__, __FILE__, "Cactus", + "CCTK_ParameterSet: Non-steerable parameter '%s::%s' is " + "not set from the parameter file but recovered from the " + "checkpoint file", + thorn, name); + retval = ParameterSet (param, value); + } } else { @@ -589,13 +594,6 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *value) } else { - if (cctk_parameter_set_mask == PARAMETER_RECOVERY_PRE && - param->props->n_set > 0) - { - old_value = CCTK_ParameterValString (param->props->name, - param->props->thorn); - } - retval = ParameterSet (param, value); /* check if a parameter is set more than once in a parfile */ @@ -608,13 +606,14 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *value) param->props->thorn); retval = strcmp (old_value, new_value) ? -10 : -11; } - free (old_value); free (new_value); } /* register another set operation */ param->props->n_set++; } + + free (old_value); } else { |