From 51cef93356584dc23771ef43ccb827a1abcf8159 Mon Sep 17 00:00:00 2001 From: rhaas Date: Thu, 4 Jul 2013 19:41:59 +0000 Subject: return "parameter already set" when resetting a fixed parameter during recovery this allows the caller to abort the run since the user tried to change a non-steerable parameter during recovery. git-svn-id: http://svn.cactuscode.org/flesh/trunk@5031 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/main/Parameters.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/Parameters.c b/src/main/Parameters.c index a56fab55..443ab6ec 100644 --- a/src/main/Parameters.c +++ b/src/main/Parameters.c @@ -603,12 +603,18 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *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", + CCTK_VWarn (1, __LINE__, __FILE__, "Cactus", + "CCTK_ParameterSet: Non-steerable parameter '%s::%s' " + "cannot be set from the parameter file but is recovered " + "from the checkpoint file", thorn, name); - retval = ParameterSet (param, value); + /* we ignore a possible error code from ParameterSet, instead always + * returning "this parameter has already been set" to our caller. + * We expect the caller to terminate, but in case they do not, we use + * the value of the parameter recovered from the checkpoint file. + */ + ParameterSet (param, value); + retval = -10; } else { -- cgit v1.2.3