File: checking-the-results.rst

package info (click to toggle)
ecflow 5.15.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,868 kB
  • sloc: cpp: 269,341; python: 22,756; sh: 3,609; perl: 770; xml: 333; f90: 204; ansic: 141; makefile: 70
file content (96 lines) | stat: -rw-r--r-- 3,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
.. _tutorial-checking-the-results:

Inspecting the results
======================

The state of a :term:`suite` can be checked using the CLI :term:`ecflow_client` or programmatically via the :ref:`Python API <python_api>`.

There are several interesting information to be inspected regarding the execution of the :term:`suite`, including:

#. The :term:`suite definition` structure loaded into the :term:`ecflow_server`.
#. The :term:`suite definition` including the :term:`status` of each :term:`node`.
#. The :term:`job file` created by the server.
#. The output of the executed :term:`task`.

Retrieving the suite definition
-------------------------------

.. tabs::

   .. tab:: CLI

       To retrieve the :term:`suite definition` in a form that is parse-able, use the :code:`--get` command:

       .. code-block:: shell

          ecflow_client --get

   .. tab:: Python

       The following Python snippet shows how to retrieve the :term:`suite definition` using the :ref:`Python API <python_api>`:

       .. code-block:: python

          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
--------------------------

.. tabs::

   .. tab:: CLI

       To retrieve the :term:`suite definition` including the state:

       .. code-block:: shell

          ecflow_client --get_state

   .. tab:: Python

       The following Python snippet shows how to retrieve the :term:`suite definition` including the state using the :ref:`Python API <python_api>`:

       .. code-block:: python

          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: :ref:`print-all-states`

Inspect the job file
--------------------

The :term:`job file` created by the server is located in the same directory as the :term:`ecf script`, and is named after the task name and the extension :code:`.jobN` (e.g. :code:`t1.job1`) where *N* is based on :code:`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 :term:`ecf script`, and is named after the task and the extension `.N` (e.g. :code:`t1.1`) where *N* is based on :code:`ECF_TRIES`.

This output file contains the standard output and standard error of the executed job.

**What to do**

#. Use the CLI :term:`ecflow_client` to retrieve the :term:`suite definition`
#. Use the CLI :term:`ecflow_client` to retrieve the :term:`suite definition` including the state
#. (Optional) Create the Python script to retrieve the :term:`suite definition`, with and without the state
#. Inspect the :term:`job file` and the output file