[Developers] If clauses in schedule

Erik Schnetter schnetter at cct.lsu.edu
Mon Apr 7 12:47:29 CDT 2008


On Apr 7, 2008, at 12:43:45, Ian Hinder wrote:
> Erik Schnetter wrote:
>> On Apr 7, 2008, at 09:48:04, Ian Hinder wrote:
>>> Erik Schnetter wrote:
>>>> Schedule items in Cactus can have WHILE clauses, which means that  
>>>> they
>>>> are executed while a certain condition are true.  I suggest to  
>>>> add IF
>>>> clauses, which would mean that they are executed only if a certain
>>>> condition is true.  The syntax is equivalent to WHILE clauses.
>>>>
>>>> This is different from the existing if statements, which are only
>>>> evaluated once at startup.  The new if clauses are evaluated every
>>>> time the schedule is traversed.
>>>
>>> Does this mean that the current implementation does not respect  
>>> changes
>>> to steerable parameters during a simulation, when those parameters  
>>> are
>>> used in if statements in schedule files?
>>>
>>> Your suggestion sounds like a good idea - it brings up the  
>>> question of
>>> why it was not done like that before.  Was there a design decision  
>>> that
>>> the schedule tree should be static?
>>
>>
>> The schedule is calculated in the beginning.  It actually has to be
>> calculated, since the dependencies have to be resolved and a correct
>> order be determined.  The current if statements are evaluated once  
>> when
>> the schedule is calculated.  This is used e.g. for choosing gauge
>> conditions or evolution systems.
>
> OK - in that case I think your suggestion is a very good idea. For
> example, I might want to change a gauge condition at some point in the
> inspiral, and the easiest way to do this would be to steer a  
> parameter.
>
> Would the current syntax be extended to allow the statements to be
> recalculated, which might have backward compatibility issues, or will
> there be a new syntax?  Perhaps we could find out if there are any  
> cases
> that broke by extending the old syntax, and fix those, as it would be
> very confusing to have two types of "if" in the schedule file.


No, it is a new syntax.  The old syntax is

	if (condition) {
	  SCHEDULE ...
	  {
	    blah
	  }
	} /* end if */

The new syntax is the same as for WHILE conditions:

	SCHEDULE ... IF condition
	{
	  blah
	}

-erik

-- 
Erik Schnetter <schnetter at cct.lsu.edu>   http://www.cct.lsu.edu/~eschnett/

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://www.cactuscode.org/pipermail/developers/attachments/20080407/952152fa/attachment.bin 


More information about the Developers mailing list