From 18b7b1b4a34e763abd455d486d4be02765e2479e Mon Sep 17 00:00:00 2001 From: Tim Pillinger <26465611+wxtim@users.noreply.github.com> Date: Tue, 23 Jul 2024 13:53:36 +0100 Subject: [PATCH] default run length => default run time (#62) Term more self explanatory. --- cylc/flow/cfgspec/workflow.py | 17 +++++++++--- .../etc/examples/extending-workflow/.validate | 22 ++++++++-------- cylc/flow/etc/syntax/cylc.lang | 2 +- cylc/flow/etc/syntax/cylc.xml | 2 +- cylc/flow/run_modes/simulation.py | 2 +- .../04-dummy-mode-output/flow.cylc | 2 +- .../events/05-timeout-ref-dummy/flow.cylc | 2 +- .../modes/03-dummy-env/flow.cylc | 2 +- .../cylc-config/00-simple/section2.stdout | 26 +++++++++---------- .../cylc-kill/03-simulation/flow.cylc | 2 +- .../02-dummy-message-outputs/flow.cylc | 2 +- .../run_modes/05-sim-trigger/flow.cylc | 2 +- .../run_modes/06-run-mode-overrides/flow.cylc | 2 +- .../run_modes/test_mode_overrides.py | 2 +- tests/integration/test_scan_api.py | 2 +- tests/integration/test_workflow_events.py | 2 +- ...uler_logs.workflow-configuration-file.html | 2 +- tests/integration/tui/test_updater.py | 2 +- tests/integration/utils/flow_tools.py | 2 +- tests/unit/run_modes/test_simulation.py | 2 +- 20 files changed, 54 insertions(+), 45 deletions(-) diff --git a/cylc/flow/cfgspec/workflow.py b/cylc/flow/cfgspec/workflow.py index 74446620941..169e285e791 100644 --- a/cylc/flow/cfgspec/workflow.py +++ b/cylc/flow/cfgspec/workflow.py @@ -1465,9 +1465,14 @@ def get_script_common_text(this: str, example: Optional[str] = None): For a full description of simulation and dummy run modes see :ref:`SimulationMode`. '''): - Conf('default run length', VDR.V_INTERVAL, DurationFloat(10), + Conf('default run time', VDR.V_INTERVAL, DurationFloat(10), desc=''' - The default simulated job run length. + + .. versionchanged:: 8.4.0 + + {REPLACES}``default run length`` + + The default simulated job run time. Used if :cylc:conf:`flow.cylc[runtime][] execution time limit` **and** @@ -1475,12 +1480,12 @@ def get_script_common_text(this: str, example: Optional[str] = None): speedup factor` are not set. ''') Conf('speedup factor', VDR.V_FLOAT, desc=''' - Simulated run length = speedup factor * execution time + Simulated run time = speedup factor * execution time limit. If :cylc:conf:`flow.cylc[runtime][] execution time limit` is set, the task - simulated run length is computed by dividing it by this + simulated run time is computed by dividing it by this factor. ''') Conf('time limit buffer', VDR.V_INTERVAL, DurationFloat(30), @@ -2169,6 +2174,10 @@ def upg(cfg, descr): ['runtime', '__MANY__', 'events', f"{old}s"], silent=cylc.flow.flags.cylc7_back_compat, ) + u.deprecate( + '8.4.0', + ['runtime', '__MANY__', 'simulation', 'default run length'], + ['runtime', '__MANY__', 'simulation', 'default run time']) u.obsolete('8.0.0', ['cylc', 'events', 'abort on stalled']) u.obsolete('8.0.0', ['cylc', 'events', 'abort if startup handler fails']) diff --git a/cylc/flow/etc/examples/extending-workflow/.validate b/cylc/flow/etc/examples/extending-workflow/.validate index 43c810372ce..3010157b387 100755 --- a/cylc/flow/etc/examples/extending-workflow/.validate +++ b/cylc/flow/etc/examples/extending-workflow/.validate @@ -20,23 +20,23 @@ set -eux test_simple () { local ID ID="$(< /dev/urandom tr -dc A-Za-z | head -c6)" - + # lint cylc lint ./simple - + # copy into a temp directory local SRC_DIR SRC_DIR="$(mktemp -d)" cp simple/flow.cylc "$SRC_DIR" - + # speed things up with simulation mode cat >>"${SRC_DIR}/flow.cylc" <<__HERE__ [runtime] [[root]] [[[simulation]]] - default run length = PT0S + default run time = PT0S __HERE__ - + # start the workflow cylc vip \ --check-circular \ @@ -45,34 +45,34 @@ __HERE__ --workflow-name "$ID" \ --mode=simulation \ "$SRC_DIR" - + # it should have reached the 2002 cycle grep '2002/a' "${HOME}/cylc-run/${ID}/log/scheduler/log" if grep '2003/a' "${HOME}/cylc-run/${ID}/log/scheduler/log"; then exit 1 fi - + # edit the "stop after cycle point" sed -i \ 's/stop after cycle point.*/stop after cycle point = 2004/' \ "${SRC_DIR}/flow.cylc" - + # continue the run cylc vr \ --no-detach \ --mode=simulation \ --yes \ "$ID" - + # it should have reached the 2004 cycle grep '2004/a' "${HOME}/cylc-run/${ID}/log/scheduler/log" if grep '2005/a' "${HOME}/cylc-run/${ID}/log/scheduler/log"; then exit 1 fi - + # clean up cylc clean "$ID" - + rm -r "${SRC_DIR}" } diff --git a/cylc/flow/etc/syntax/cylc.lang b/cylc/flow/etc/syntax/cylc.lang index 0270c7f3cfc..1b4853cc94c 100644 --- a/cylc/flow/etc/syntax/cylc.lang +++ b/cylc/flow/etc/syntax/cylc.lang @@ -190,7 +190,7 @@ disable task event handlers directives description - default run length + default run time default cycling mode cycle point time zone diff --git a/cylc/flow/etc/syntax/cylc.xml b/cylc/flow/etc/syntax/cylc.xml index da11c1215e1..82e045c9db1 100644 --- a/cylc/flow/etc/syntax/cylc.xml +++ b/cylc/flow/etc/syntax/cylc.xml @@ -117,7 +117,7 @@ - + diff --git a/cylc/flow/run_modes/simulation.py b/cylc/flow/run_modes/simulation.py index 659808f7451..886199d1728 100644 --- a/cylc/flow/run_modes/simulation.py +++ b/cylc/flow/run_modes/simulation.py @@ -224,7 +224,7 @@ def get_simulated_run_len(rtc: Dict[str, Any]) -> int: str(limit)).get_seconds() / speedup) else: sleep_sec = DurationParser().parse( - str(rtc['simulation']['default run length']) + str(rtc['simulation']['default run time']) ).get_seconds() return sleep_sec diff --git a/tests/flakyfunctional/cylc-get-config/04-dummy-mode-output/flow.cylc b/tests/flakyfunctional/cylc-get-config/04-dummy-mode-output/flow.cylc index 4db81ada9ee..052b00c9387 100644 --- a/tests/flakyfunctional/cylc-get-config/04-dummy-mode-output/flow.cylc +++ b/tests/flakyfunctional/cylc-get-config/04-dummy-mode-output/flow.cylc @@ -19,7 +19,7 @@ [[root]] script = true [[[simulation]]] - default run length = PT0S + default run time = PT0S [[foo]] script = true [[[outputs]]] diff --git a/tests/flakyfunctional/events/05-timeout-ref-dummy/flow.cylc b/tests/flakyfunctional/events/05-timeout-ref-dummy/flow.cylc index 52d723fead1..5b150eecc10 100644 --- a/tests/flakyfunctional/events/05-timeout-ref-dummy/flow.cylc +++ b/tests/flakyfunctional/events/05-timeout-ref-dummy/flow.cylc @@ -11,4 +11,4 @@ script = "false" [[[simulation]]] fail cycle points = 1 - default run length = PT0S + default run time = PT0S diff --git a/tests/flakyfunctional/modes/03-dummy-env/flow.cylc b/tests/flakyfunctional/modes/03-dummy-env/flow.cylc index e4a5d678712..d94938d2988 100644 --- a/tests/flakyfunctional/modes/03-dummy-env/flow.cylc +++ b/tests/flakyfunctional/modes/03-dummy-env/flow.cylc @@ -4,7 +4,7 @@ [runtime] [[root]] [[[simulation]]] - default run length = PT0S + default run time = PT0S [[oxygas]] pre-script = echo "[MY-PRE-SCRIPT] \${CYLC_TASK_NAME} is ${CYLC_TASK_NAME}" script = """ diff --git a/tests/functional/cylc-config/00-simple/section2.stdout b/tests/functional/cylc-config/00-simple/section2.stdout index a85ed449573..a38843595e5 100644 --- a/tests/functional/cylc-config/00-simple/section2.stdout +++ b/tests/functional/cylc-config/00-simple/section2.stdout @@ -24,7 +24,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -103,7 +103,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -182,7 +182,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -263,7 +263,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -343,7 +343,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -423,7 +423,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -503,7 +503,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -583,7 +583,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -663,7 +663,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -743,7 +743,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -823,7 +823,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -903,7 +903,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = @@ -983,7 +983,7 @@ outputs = disable task event handlers = True [[[simulation]]] - default run length = PT10S + default run time = PT10S speedup factor = time limit buffer = PT30S fail cycle points = diff --git a/tests/functional/cylc-kill/03-simulation/flow.cylc b/tests/functional/cylc-kill/03-simulation/flow.cylc index 03b6249e962..2a0a288a040 100644 --- a/tests/functional/cylc-kill/03-simulation/flow.cylc +++ b/tests/functional/cylc-kill/03-simulation/flow.cylc @@ -8,5 +8,5 @@ [runtime] [[root]] [[[simulation]]] - default run length = PT30S + default run time = PT30S [[foo]] diff --git a/tests/functional/run_modes/02-dummy-message-outputs/flow.cylc b/tests/functional/run_modes/02-dummy-message-outputs/flow.cylc index 6b3817508a2..17db8085abd 100644 --- a/tests/functional/run_modes/02-dummy-message-outputs/flow.cylc +++ b/tests/functional/run_modes/02-dummy-message-outputs/flow.cylc @@ -12,7 +12,7 @@ [runtime] [[root]] [[[simulation]]] - default run length = PT0S + default run time = PT0S time limit buffer = PT1M [[bar]] [[foo]] diff --git a/tests/functional/run_modes/05-sim-trigger/flow.cylc b/tests/functional/run_modes/05-sim-trigger/flow.cylc index 2220e958e00..47dff9285ea 100644 --- a/tests/functional/run_modes/05-sim-trigger/flow.cylc +++ b/tests/functional/run_modes/05-sim-trigger/flow.cylc @@ -5,7 +5,7 @@ [runtime] [[root, bar]] [[[simulation]]] - default run length = PT0S + default run time PT0S [[fail_fail_fail]] [[[simulation]]] fail cycle points = all diff --git a/tests/functional/run_modes/06-run-mode-overrides/flow.cylc b/tests/functional/run_modes/06-run-mode-overrides/flow.cylc index b7693232149..a6c2dc5f736 100644 --- a/tests/functional/run_modes/06-run-mode-overrides/flow.cylc +++ b/tests/functional/run_modes/06-run-mode-overrides/flow.cylc @@ -17,7 +17,7 @@ [[root]] script = echo "=== this task ran in live mode ===" [[[simulation]]] - default run length = PT0S + default run time = PT0S [[default_]] [[live_]] run mode = live diff --git a/tests/integration/run_modes/test_mode_overrides.py b/tests/integration/run_modes/test_mode_overrides.py index 209837ebb7e..bfeee4a12ce 100644 --- a/tests/integration/run_modes/test_mode_overrides.py +++ b/tests/integration/run_modes/test_mode_overrides.py @@ -44,7 +44,7 @@ async def test_run_mode_override( "runtime": { "sim_": { "run mode": "simulation", - 'simulation': {'default run length': 'PT0S'} + 'simulation': {'default run time': 'PT0S'} }, "skip_": {"run mode": "skip"}, } diff --git a/tests/integration/test_scan_api.py b/tests/integration/test_scan_api.py index 71d83124f77..55f2ba13034 100644 --- a/tests/integration/test_scan_api.py +++ b/tests/integration/test_scan_api.py @@ -81,7 +81,7 @@ async def flows(mod_flow, mod_scheduler, mod_run, mod_one_conf): }, 'runtime': { 'foo': { - 'simulation': {'default run length': 'PT10S'} + 'simulation': {'default run time': 'PT10S'} } } }, diff --git a/tests/integration/test_workflow_events.py b/tests/integration/test_workflow_events.py index b41b03e7210..ee0ae583e49 100644 --- a/tests/integration/test_workflow_events.py +++ b/tests/integration/test_workflow_events.py @@ -60,7 +60,7 @@ def _schd(config=None, **opts): 'runtime': { 'a': { 'simulation': { - 'default run length': 'PT0S', + 'default run time': 'PT0S', } } }, diff --git a/tests/integration/tui/screenshots/test_scheduler_logs.workflow-configuration-file.html b/tests/integration/tui/screenshots/test_scheduler_logs.workflow-configuration-file.html index c7ab1e925ec..daa7ef731bc 100644 --- a/tests/integration/tui/screenshots/test_scheduler_logs.workflow-configuration-file.html +++ b/tests/integration/tui/screenshots/test_scheduler_logs.workflow-configuration-file.html @@ -10,7 +10,7 @@ [[a]] [[root]] [[[simulation]]] - default run length = PT0S + default run time = PT0S [scheduler] allow implicit tasks = True diff --git a/tests/integration/tui/test_updater.py b/tests/integration/tui/test_updater.py index 3fa310b6966..2df81d99cec 100644 --- a/tests/integration/tui/test_updater.py +++ b/tests/integration/tui/test_updater.py @@ -154,7 +154,7 @@ async def test_filters(one_conf, flow, scheduler, run, updater): # https://github.com/cylc/cylc-flow/pull/5721 'root': { 'simulation': { - 'default run length': 'PT1M', + 'default run time': 'PT1M', }, }, }, diff --git a/tests/integration/utils/flow_tools.py b/tests/integration/utils/flow_tools.py index fef15e3e3dc..f1ec025d0b8 100644 --- a/tests/integration/utils/flow_tools.py +++ b/tests/integration/utils/flow_tools.py @@ -80,7 +80,7 @@ def _make_flow( conf.setdefault('runtime', {}) .setdefault('root', {}) .setdefault('simulation', {}) - .setdefault('default run length', 'PT0S') + .setdefault('default run time', 'PT0S') ) # allow implicit tasks by default: conf.setdefault('scheduler', {}).setdefault( diff --git a/tests/unit/run_modes/test_simulation.py b/tests/unit/run_modes/test_simulation.py index 109174c8b43..f6d6d300558 100644 --- a/tests/unit/run_modes/test_simulation.py +++ b/tests/unit/run_modes/test_simulation.py @@ -48,7 +48,7 @@ def test_get_simulated_run_len( 'execution time limit': execution_time_limit, 'simulation': { 'speedup factor': speedup_factor, - 'default run length': default_run_length, + 'default run time': default_run_length, 'time limit buffer': 'PT0S', } }