Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default run length => default run time #62

Merged
merged 1 commit into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions cylc/flow/cfgspec/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,22 +1465,27 @@ 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][<namespace>]
execution time limit` **and**
:cylc:conf:`flow.cylc[runtime][<namespace>][simulation]
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][<namespace>]
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),
Expand Down Expand Up @@ -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'])
Expand Down
22 changes: 11 additions & 11 deletions cylc/flow/etc/examples/extending-workflow/.validate
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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}"
}

Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/etc/syntax/cylc.lang
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<keyword>disable task event handlers</keyword>
<keyword>directives</keyword>
<keyword>description</keyword>
<keyword>default run length</keyword>
<keyword>default run time</keyword>
<keyword>default</keyword>
<keyword>cycling mode</keyword>
<keyword>cycle point time zone</keyword>
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/etc/syntax/cylc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<RegExpr attribute='Keyword' String=' disable task event handlers '/>
<RegExpr attribute='Keyword' String=' directives '/>
<RegExpr attribute='Keyword' String=' description '/>
<RegExpr attribute='Keyword' String=' default run length '/>
<RegExpr attribute='Keyword' String=' default run time '/>
<RegExpr attribute='Keyword' String=' default '/>
<RegExpr attribute='Keyword' String=' cycling mode '/>
<RegExpr attribute='Keyword' String=' cycle point time zone '/>
Expand Down
2 changes: 1 addition & 1 deletion cylc/flow/run_modes/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
[[root]]
script = true
[[[simulation]]]
default run length = PT0S
default run time = PT0S
[[foo]]
script = true
[[[outputs]]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
script = "false"
[[[simulation]]]
fail cycle points = 1
default run length = PT0S
default run time = PT0S
2 changes: 1 addition & 1 deletion tests/flakyfunctional/modes/03-dummy-env/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = """
Expand Down
26 changes: 13 additions & 13 deletions tests/functional/cylc-config/00-simple/section2.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/cylc-kill/03-simulation/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
[runtime]
[[root]]
[[[simulation]]]
default run length = PT30S
default run time = PT30S
[[foo]]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[runtime]
[[root]]
[[[simulation]]]
default run length = PT0S
default run time = PT0S
time limit buffer = PT1M
[[bar]]
[[foo]]
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/run_modes/05-sim-trigger/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[runtime]
[[root, bar]]
[[[simulation]]]
default run length = PT0S
default run time PT0S
[[fail_fail_fail]]
[[[simulation]]]
fail cycle points = all
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/run_modes/06-run-mode-overrides/flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/run_modes/test_mode_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_scan_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_workflow_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _schd(config=None, **opts):
'runtime': {
'a': {
'simulation': {
'default run length': 'PT0S',
'default run time': 'PT0S',
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> [[a]] </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> [[root]] </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> [[[simulation]]] </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> default run length = PT0S </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> default run time = PT0S </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">[scheduler] </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> allow implicit tasks = True </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
<span style="color:#000000;background:#e5e5e5">│</span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5"> </span><span style="color:#000000;background:#e5e5e5">│</span>
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/tui/test_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/utils/flow_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/run_modes/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
}
Expand Down
Loading