You can check definition for valid trigger expression and in-limits for existing definition file using the command:
|
|
---|
This will check that the suite definition is correct and can be loaded into the server.
However, typically Definition files are built using the python API, where most checks are done whilst the definition is being built. (i.e. duplicate node names at the same level)
Code Block | ||||
---|---|---|---|---|
| ||||
import os
from ecflow import Defs,Suite,Task,Edit
home = os.path.join(os.getenv("HOME"), "course")
defs = Defs(
Suite('test',
Edit(ECF_HOME=home),
Task('t1')))
print(defs.check()) |
Simulation and Verification
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 | ||||
---|---|---|---|---|
| ||||
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()
...