Skip to content

Commit 430a971

Browse files
Merge pull request #808 from cylc/8.4.x-sync
🤖 Merge 8.4.x-sync into master
2 parents 6e1ef95 + 8e61485 commit 430a971

File tree

2 files changed

+76
-16
lines changed

2 files changed

+76
-16
lines changed

src/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@
142142
('py:class', 'SubFuncContext'),
143143
('py:exc', 'ISO8601SyntaxError'),
144144
('py:exc', 'StrftimeSyntaxError'),
145+
('py:class', 'ResponseDict'),
146+
]
147+
nitpick_ignore_regex = [
148+
# intersphinx has trouble with pyzmq classes:
149+
('py:class', r'zmq\.asyncio\.\w+')
145150
]
146151

147152
# List of patterns, relative to source directory, that match files and
@@ -164,11 +169,6 @@
164169
'https?://matrix.to/.*#.*',
165170
]
166171

167-
nitpick_ignore_regex = [
168-
# intersphinx has trouble with pyzmq classes:
169-
('py:class', r'zmq\.asyncio\.\w+')
170-
]
171-
172172
# -- Options for Slides output ----------------------------------------------
173173

174174
slide_theme = 'single-level'

src/user-guide/writing-workflows/scheduling.rst

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,14 +1507,62 @@ to the task cycle point.
15071507
Clock-Expire Triggers
15081508
^^^^^^^^^^^^^^^^^^^^^
15091509

1510-
Tasks can be configured to :term:`expire <expired task>` if the wall clock
1511-
time exceeds some offset from their cycle point.
1510+
Tasks can be configured to :term:`expire <expired task>` if the real-world
1511+
(wall clock) time exceeds some offset from their cycle point.
15121512

1513+
Task expiration is configured with
1514+
:cylc:conf:`[scheduling][special tasks]clock-expire` using a syntax like
1515+
:cylc:conf:`clock-trigger <[scheduling][special tasks]clock-trigger>`
1516+
with a datetime offset relative to cycle point.
1517+
The offset should be positive to make the task expire if the wallclock time
1518+
has gone beyond the cycle point.
1519+
1520+
In this example:
1521+
1522+
* The task ``foo`` is configured to expire when the wall clock
1523+
time passes the cycle time:
1524+
* Whereas ``bar`` is configured to expire one hour *after* the cycle time.
1525+
1526+
.. code-block:: cylc
15131527
1514-
The associated ``:expire`` :term:`output <task output>` can be used to
1528+
[scheduling]
1529+
[[special tasks]]
1530+
clock-expire = foo, bar(PT1H)
1531+
1532+
So, in the cycle ``2000-01-01T00:00Z``:
1533+
1534+
* ``foo`` would expire at ``2000-01-01T00:00Z``.
1535+
* ``bar`` would expire at ``2000-01-01T01:00Z``.
1536+
1537+
Only waiting tasks can expire, :term:`active tasks <active>` will not be
1538+
killed if they pass their configured ``clock-expire`` time.
1539+
1540+
When a task expires, it produces the ``expired`` :term:`output`.
1541+
This can be used to
15151542
trigger other tasks. It must be marked as an :term:`optional output`,
15161543
i.e. expiry cannot be :term:`required <required output>`.
15171544

1545+
In this example:
1546+
1547+
* ``foo`` will not run before the wall clock time.
1548+
* ``foo`` will expire if it does not start running within 6 hours of the wall
1549+
clock time being reached.
1550+
* If ``foo`` runs, the task ``bar`` will run after.
1551+
* If ``foo`` expires, the task ``baz`` will run after.
1552+
1553+
.. code-block:: cylc
1554+
1555+
[scheduling]
1556+
initial cycle point = 2000
1557+
[[special tasks]]
1558+
clock-expire = foo(PT6H)
1559+
[[graph]]
1560+
P1D = """
1561+
@wall_clock => foo
1562+
foo => bar
1563+
foo:expired? => baz
1564+
"""
1565+
15181566
Family triggers are also provided for task expiry:
15191567

15201568
.. code-block:: cylc-graph
@@ -1523,19 +1571,31 @@ Family triggers are also provided for task expiry:
15231571
FAM:expire-all? => baz
15241572
FAM:expire-any? => qux
15251573
1526-
Task expiration is configured with
1527-
:cylc:conf:`[scheduling][special tasks]clock-expire` using a syntax like
1528-
:cylc:conf:`clock-trigger <[scheduling][special tasks]clock-trigger>`
1529-
with a datetime offset relative to cycle point.
1530-
1531-
The offset should be positive to make the task expire if the wallclock time
1532-
has gone beyond the cycle point.
1533-
15341574
.. warning::
15351575

15361576
The scheduler can only determine that a task has expired once it
15371577
enters the :term:`n=0 window <n-window>`.
15381578

1579+
This means that at least one of a task's prerequisites must be satisfied
1580+
before the task may expire.
1581+
1582+
So in the following example, the task ``b`` will only expire, **after**
1583+
the task ``a`` has succeeded:
1584+
1585+
.. code-block:: cylc
1586+
1587+
[scheduling]
1588+
initial cycle point = 2000
1589+
[[special tasks]]
1590+
clock-expire = b
1591+
[[graph]]
1592+
P1D = a => b
1593+
1594+
.. seealso::
1595+
1596+
For worked examples of workflows that use expiry, see the
1597+
:ref:`examples section<examples.expiry>`.
1598+
15391599

15401600
.. _WorkflowConfigExternalTriggers:
15411601

0 commit comments

Comments
 (0)