Inspecting the results
The state of a suite can be checked using the CLI ecflow_client or programmatically via the Python API.
There are several interesting information to be inspected regarding the execution of the suite, including:
The suite definition structure loaded into the ecflow_server.
The suite definition including the status of each node.
The job file created by the server.
The output of the executed task.
Retrieving the suite definition
To retrieve the suite definition in a form that is parse-able, use the --get command:
ecflow_client --get
The following Python snippet shows how to retrieve the suite definition using the Python API:
import ecflow
try:
ci = ecflow.Client() # create the client, will read ECF_HOST and ECF_PORT from environment
ci.sync_local() # get server definition, by syncing with client defs
ecflow.PrintStyle.set_style( ecflow.Style.DEFS ) # set printing to show structure
print(ci.get_defs()) # print the returned suite definition
except RuntimeError as e:
print("Failed:",e)
Retrieving the suite state
To retrieve the suite definition including the state:
ecflow_client --get_state
The following Python snippet shows how to retrieve the suite definition including the state using the Python API:
import ecflow
try:
ci = ecflow.Client()
ci.sync_local() # retrieve server definition, by sync with client defs
ecflow.PrintStyle.set_style( ecflow.Style.STATE ) # set printing to show structure and state, expanded trigger expression, generated variables
print(ci.get_defs()) # print the returned suite definition
ecflow.PrintStyle.set_style( ecflow.Style.MIGRATE ) # set printing to show structure and state, and node history
print(ci.get_defs()) # print the returned suite definition
except RuntimeError as e:
print("Failed:", e)
To list just the node paths and states in python please see: How can I access the path and task states?
Inspect the job file
The job file created by the server is located in the same directory as the ecf script, and is named after the task name and the extension .jobN (e.g. t1.job1) where N is based on ECF_TRIES.
Is is usefull to compare the files jobs files and include files, with the job file.
Inspect the job output
The output of the job is located in the same directory as the ecf script, and is named after the task and the extension .N (e.g. t1.1) where N is based on ECF_TRIES.
This output file contains the standard output and standard error of the executed job.
What to do
Use the CLI ecflow_client to retrieve the suite definition
Use the CLI ecflow_client to retrieve the suite definition including the state
(Optional) Create the Python script to retrieve the suite definition, with and without the state
Inspect the job file and the output file