[Developers] Logic error in CCTK_ParameterSet?

Thomas Radke tradke at aei.mpg.de
Fri Aug 11 09:59:23 CDT 2006


> Then setting the parameter would be omitted only if the parameter is  
> never steerable and if it is identical.  For steerable parameters  there 
> is no test whether ParameterSet would be no-op, and it always  happens.

The code in question is supposed to deal with non-steerable parameters 
only. If the user tries to set one to a different value during recovery 
then a warning should be issued and the request will be ignored.

In general, _all_ parameters are set first from the parfile in the 
PARAMETER_RECOVERY_PRE bin (line 597ff). Then follows the 
PARAMETER_RECOVERY_IN bin (line 570ff) which reverts previous requests 
to set a non-steerable parameter by overwriting its value with the one 
taken from the checkpoint.

> I'm concerned that CCTK_ParameterQueryTimesSet then becomes difficult  
> to interpret, since its "natural" value depends on whether the run is  
> restarted, whether the parameter is steerable, and whether the  
> parameter file and the checkpoint file contained the same value.

I agree it's somewhat difficult to interpret. The way it works now is 
that for a normal run CCTK_ParameterQueryTimesSet() would return 1 if 
the parameter has been set in the parfile, 0 otherwise. For a recovered 
run it would be 2 and 1 respectively because, in general, all parameters 
are recovered (ie. set) from the checkpoint, and potentially again in 
the parfile.
And, of course, the value returned by CCTK_ParameterQueryTimesSet() is 
increased for each (successful) call to CCTK_ParameterSet().

> Does a check for string equality catch really all cases of equality?   
> What if an integer parameter has the value "5" and is set to "+5"?

I think it does, although it may not look like it. A value of "+5" can 
only appear in a parfile, given by a user. A checkpoint always contains 
stringified values of parameters as returned by 
CCTK_ParameterValString(), which would be "5" in the above case. This 
then exactly matches the stringified value of the parameter value set in 
the parfile.

-- 
Cheers, Thomas.


More information about the Developers mailing list