Skip to content

Commit

Permalink
Hilary review 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsutherland committed Mar 21, 2024
1 parent c1bb3ab commit f09ea62
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
6 changes: 3 additions & 3 deletions cylc/flow/cfgspec/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,17 +802,17 @@ def get_script_common_text(this: str, example: Optional[str] = None):
:ref:`SequentialTasks`.
''')

Conf('spawn from xtriggers sequentially', VDR.V_BOOLEAN, False,
Conf('sequential xtriggers', VDR.V_BOOLEAN, False,
desc='''
If ``True``, tasks that only depend on xtriggers will not spawn
until their previous (cycle point) instance is satisfied.
until the xtrigger of previous (cycle point) instance is satisfied.
Otherwise, they will all spawn at once out to the runahead limit.
This setting can be overridden by the reserved keyword argument
``sequential`` in individual xtrigger declarations.
One sequential xtrigger on a parentless task with multiple
xtriggers will cause sequential behavior.
xtriggers will cause sequential spawning.
''')
with Conf('xtriggers', desc='''
This section is for *External Trigger* function declarations -
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,7 +1715,7 @@ def generate_triggers(self, lexpression, left_nodes, right, seq,

if self.xtrigger_mgr is not None:
self.xtrigger_mgr.sequential_xtriggers_default = (
self.cfg['scheduling']['spawn from xtriggers sequentially']
self.cfg['scheduling']['sequential xtriggers']
)
for label in xtrig_labels:
try:
Expand Down
14 changes: 6 additions & 8 deletions cylc/flow/xtrigger_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,18 @@ class XtriggerManager:
# Example:
[scheduling]
sequential xtrigger default = True
sequential xtriggers = True
[[xtriggers]]
clock_0 = wall_clock() # offset PT0H
clock_1 = wall_clock(offset=PT1H)
# or wall_clock(PT1H)
# "sequential=False" here overrides workflow and function default.
clock_0 = wall_clock(sequential=False)
workflow_x = workflow_state(
workflow=other,
point=%(task_cycle_point)s,
sequential=False
):PT30S
[[graph]]
PT1H = '''
@clock_1 & @workflow_x => foo & bar
@wall_clock = baz # pre-defined zero-offset clock
@workflow_x => foo & bar # spawned on workflow_x satisfaction
@clock_0 => baz # baz spawned out to RH
'''
Args:
Expand Down Expand Up @@ -259,7 +257,7 @@ def __init__(
# Labels whose xtriggers are sequentially checked.
self.sequential_xtrigger_labels: Set[str] = set()
# Gather parentless tasks whose xtrigger(s) have been satisfied
# (these will be used to spawn the next occurance).
# (these will be used to spawn the next occurrence).
self.sequential_spawn_next: Set[str] = set()
self.sequential_has_spawned_next: Set[str] = set()

Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cylc-config/00-simple/section1.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ hold after cycle point =
stop after cycle point =
cycling mode = integer
runahead limit = P4
spawn from xtriggers sequentially = False
sequential xtriggers = False
[[queues]]
[[[default]]]
limit = 100
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/xtriggers/04-sequential.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ init_workflow "${TEST_NAME_BASE}" << '__FLOW_CONFIG__'
[scheduling]
initial cycle point = 3000
runahead limit = P5
spawn from xtriggers sequentially = True
sequential xtriggers = True
[[xtriggers]]
clock_1 = wall_clock(offset=P2Y, sequential=False)
clock_2 = wall_clock()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_sequential_xtriggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ async def test_override(flow, scheduler, start):
"""Test that the 'sequential=False' arg can override a default of True."""
wid = flow({
'scheduling': {
'spawn from xtriggers sequentially': True,
'sequential xtriggers': True,
'xtriggers': {
'xt1': 'custom_xt()',
'xt2': 'custom_xt(sequential=False)',
Expand Down

0 comments on commit f09ea62

Please sign in to comment.