[Developers] If clauses in schedule

David Rideout dprideout at gmail.com
Mon Apr 7 12:58:05 CDT 2008


Just to clarify, this could already be done with the WHILE option for
a schedule item, by defining a grid scalar and playing with its value
inside scheduled routines.  Erik is proposing a *much* simpler way to
implement (dynamic) if logic.

-David

On Mon, Apr 7, 2008 at 1:47 PM, Erik Schnetter <schnetter at cct.lsu.edu> wrote:
>
> 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.
>
>
>
>
> _______________________________________________
>  Developers mailing list
>  Developers at cactuscode.org
>  http://www.cactuscode.org/mailman/listinfo/developers
>
>


More information about the Developers mailing list