@@ -1507,14 +1507,62 @@ to the task cycle point.
1507
1507
Clock-Expire Triggers
1508
1508
^^^^^^^^^^^^^^^^^^^^^
1509
1509
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.
1512
1512
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
1513
1527
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
1515
1542
trigger other tasks. It must be marked as an :term: `optional output `,
1516
1543
i.e. expiry cannot be :term: `required <required output> `.
1517
1544
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
+
1518
1566
Family triggers are also provided for task expiry:
1519
1567
1520
1568
.. code-block :: cylc-graph
@@ -1523,19 +1571,31 @@ Family triggers are also provided for task expiry:
1523
1571
FAM:expire-all? => baz
1524
1572
FAM:expire-any? => qux
1525
1573
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
-
1534
1574
.. warning ::
1535
1575
1536
1576
The scheduler can only determine that a task has expired once it
1537
1577
enters the :term: `n=0 window <n-window> `.
1538
1578
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
+
1539
1599
1540
1600
.. _WorkflowConfigExternalTriggers :
1541
1601
0 commit comments