Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can also use the simulator, allowing you to predict/verify the behaviour of your suite in a few seconds. The simulator is available with the python apiAPI.

The simulator will analyse the definition, and simulate the ecFlow server. Allowing time dependencies that span several months, to be simulated in a few seconds.

 ecFlow allows the use of 'verify' attributes. This example shows how we can verify the number of times a task should run, given a start(optional, but required when using time-based attributes) and end time(optional).

...

 Please note, for deterministic behaviour, the start and end clock should be specified when using time-based attributes.

 However, if no 'endclock' is specified the simulation run will assume the following defaults.

  • No time dependencies: 24 hours
  • time || today                : 24 hours
  • day                          day                                : 1 week
  • date            date                                  : 1 month
  • cron              cron                               : 1 year
  • repeat                           : 1 year

...

If we find time dependencies with a minute resolution, then this is used. (Otherwise, we use 1-hour resolution).   If there no time dependencies then the simulator will by default use 1-hour resolution.

This needs to be taken into account when specifying the verify attribute

If the simulation does not complete it creates  creates defs.flat and  and defs.depth files.

This provides clues as to the state of the definition at the end of the simulation

Code Block
languagepy
titleCalling the simulator in python
import ecflow
defs = Defs('suite.def')        # specify the defs we want to simulate 
theResults = defs.simulate()    # call the simulator
print theResults                # check the results.

 If the definition was creating created directly with the python apiAPI, then we need only call 'defs.simulate()

...