Skip to content

Commit

Permalink
Merge pull request #3184 from matthewrmshin/stop-point
Browse files Browse the repository at this point in the history
Correctly store stop_point, etc for restart
  • Loading branch information
matthewrmshin authored Jul 5, 2019
2 parents 179f3de + e3c69e9 commit d774fe0
Show file tree
Hide file tree
Showing 37 changed files with 1,458 additions and 519 deletions.
27 changes: 27 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,33 @@ invalid cylc command is used (instead of a ValueError).
[#3003](https://github.com/cylc/cylc-flow/pull/3003) - Fix inheritance
with quotes using shlex.

[#3184](https://github.com/cylc/cylc-flow/pull/3184) - Fix restart
correctness when the suite has a hold point, stop point, a stop task, a stop
clock time and/or an auto stop option. These settings are now stored in the
suite run SQLite file and are retrieved on suite restart. In addition, the
settings are removed when they are consumed, e.g. if the suite stopped
previously on reaching the stop point, the stop point would be consumed, so
that on restart the suite would not stop again immediately.

The `cylc run` command can now accept `--initial-cycle-point=CYCLE-POINT`
(`--icp=CYCLE-POINT)` and `--start-cycle-point=CYCLE-POINT` options. This
change should allow the command to have a more uniform interface with commands
such as `cylc validate`, and with the final/stop cycle point options).

After this change:
* `cylc run SUITE POINT` is equivalent to `cylc run --icp=POINT SUITE`.
* `cylc run -w SUITE POINT` is equivalent to
`cylc run -w --start-point=POINT SUITE`.

The `cylc run` and `cylc restart` commands can now accept the
`--final-cycle-point=POINT` and `--stop-cycle-point=POINT` options. The
`--until=POINT` option is now an alias for `--final-cycle-point=POINT` option.

The `cylc run` and `cylc restart` commands can now accept the new
`--auto-shutdown` option. This option overrides the equivalent suite
configuration to force auto shutdown to be enabled. Previously, it is only
possible to disable auto shutdown on the command line.

### Documentation

[#3181](https://github.com/cylc/cylc-flow/pull/3181) - moved documentation to
Expand Down
4 changes: 3 additions & 1 deletion bin/cylc-check-versions
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def main(_, opts, *args):

# extract task host accounts from the suite
config = SuiteConfig(
suite, suiterc,
suite,
suiterc,
options,
load_template_vars(options.templatevars, options.templatevars_file))
account_set = set()
for name in config.get_namespace_list('all tasks'):
Expand Down
7 changes: 2 additions & 5 deletions bin/cylc-diff
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,10 @@ def main(parser, options, *args):
print("Parsing %s (%s)" % (suite1, suite1rc))
template_vars = load_template_vars(
options.templatevars, options.templatevars_file)
config1 = SuiteConfig(
suite1, suite1rc, template_vars,
cli_initial_point_string=options.icp).cfg
config1 = SuiteConfig(suite1, suite1rc, options, template_vars).cfg
print("Parsing %s (%s)" % (suite2, suite2rc))
config2 = SuiteConfig(
suite2, suite2rc, template_vars,
cli_initial_point_string=options.icp, is_reload=True).cfg
suite2, suite2rc, options, template_vars, is_reload=True).cfg

if config1 == config2:
print("Suite definitions %s and %s are identical" % (suite1, suite2))
Expand Down
7 changes: 4 additions & 3 deletions bin/cylc-get-suite-config
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ def main(parser, options, reg):
prefix = ''

config = SuiteConfig(
suite, suiterc,
load_template_vars(options.templatevars, options.templatevars_file),
cli_initial_point_string=options.icp, run_mode=options.run_mode)
suite,
suiterc,
options,
load_template_vars(options.templatevars, options.templatevars_file))
if options.tasks:
for task in config.get_task_name_list():
print(prefix + task)
Expand Down
7 changes: 3 additions & 4 deletions bin/cylc-graph
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,15 @@ def graph_inheritance(config):
print('stop')


def get_config(suite, icp=None, template_vars=None):
def get_config(suite, opts, template_vars=None):
"""Return a SuiteConfig object for the provided reg / path."""
try:
suiterc = SuiteSrvFilesManager().get_suite_rc(suite)
except SuiteServiceFileError:
# could not find suite, assume we have been given a path instead
suiterc = suite
suite = 'test'
return SuiteConfig(suite, suiterc, cli_initial_point_string=icp,
template_vars=template_vars)
return SuiteConfig(suite, suiterc, opts, template_vars=template_vars)


def get_option_parser():
Expand Down Expand Up @@ -230,7 +229,7 @@ def main(parser, opts, suite=None, start=None, stop=None):
template_vars = load_template_vars(
opts.templatevars, opts.templatevars_file)

config = get_config(suite, icp=opts.icp, template_vars=template_vars)
config = get_config(suite, opts, template_vars=template_vars)
if opts.namespaces:
graph_inheritance(config)
else:
Expand Down
7 changes: 4 additions & 3 deletions bin/cylc-list
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ def main(parser, options, reg):
[options.all_tasks, options.all_namespaces, options.mro]):
print("WARNING: -t chosen, ignoring non-tree options.", file=sys.stderr)
config = SuiteConfig(
suite, suiterc,
load_template_vars(options.templatevars, options.templatevars_file),
cli_initial_point_string=options.icp)
suite,
suiterc,
options,
load_template_vars(options.templatevars, options.templatevars_file))
if options.tree:
config.print_first_parent_tree(
pretty=options.box, titles=options.titles)
Expand Down
7 changes: 4 additions & 3 deletions bin/cylc-submit
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ def main(parser, options, suite, *task_ids):

# Load suite config and tasks
config = SuiteConfig(
suite, suiterc,
load_template_vars(options.templatevars, options.templatevars_file),
cli_initial_point_string=options.icp)
suite,
suiterc,
options,
load_template_vars(options.templatevars, options.templatevars_file))
itasks = []
for task_id in task_ids:
name_str, point_str = TaskID.split(task_id)
Expand Down
8 changes: 5 additions & 3 deletions bin/cylc-validate
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ def parse_args():
default="live", dest="run_mode",
choices=['live', 'dummy', 'dummy-local', 'simulation'])

parser.set_defaults(is_validate=True)

return parser


Expand All @@ -92,10 +94,10 @@ def main(_, options, reg):

suite, suiterc = SuiteSrvFilesManager().parse_suite_arg(options, reg)
cfg = SuiteConfig(
suite, suiterc,
suite,
suiterc,
options,
load_template_vars(options.templatevars, options.templatevars_file),
cli_initial_point_string=options.icp,
is_validate=True, strict=options.strict, run_mode=options.run_mode,
output_fname=options.output, mem_log_func=profiler.log_memory)

# Check bounds of sequences
Expand Down
Loading

0 comments on commit d774fe0

Please sign in to comment.