From 9bb09aae2b66a61eb39ed44b923308737aa232fc Mon Sep 17 00:00:00 2001 From: rhaas Date: Thu, 4 Jul 2013 19:43:35 +0000 Subject: abort run when user tries to change a non-steerable parameter during recovery git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOUtil/trunk@303 b32723a9-ab3a-4a60-88e2-2e5d99d7c17a --- src/CheckpointRecovery.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/CheckpointRecovery.c b/src/CheckpointRecovery.c index 72e8e90..328053e 100644 --- a/src/CheckpointRecovery.c +++ b/src/CheckpointRecovery.c @@ -898,10 +898,12 @@ void IOUtil_SetAllParameters (const char *parameters) char *name, *thorn_impl, *parameter_string, *free_me; const char *thorn; const cParamData *paramdata; + int ierr, steered_non_steerable; DECLARE_CCTK_PARAMETERS parameter_string = free_me = strdup (parameters); + steered_non_steerable = 0; while (*parameter_string) { /* find the end of the current " = " pair substring */ @@ -943,7 +945,12 @@ void IOUtil_SetAllParameters (const char *parameters) if (paramdata && ! paramdata->accumulator_expression) { decoded_value = DecodeString (avalue); - if (CCTK_ParameterSet (name, thorn, decoded_value) < 0) + ierr = CCTK_ParameterSet (name, thorn, decoded_value); + if (ierr == -10) + { + steered_non_steerable = 1; + } + else if (ierr < 0) { CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, "Couldn't set parameter '%s' to '%s'", @@ -977,6 +984,11 @@ void IOUtil_SetAllParameters (const char *parameters) } free (free_me); + + if (steered_non_steerable) + { + CCTK_ERROR ("Attempted to steer non steerable parameters."); + } } -- cgit v1.2.3