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

Make --stopcp=reload use [scheduling]stop after cycle point instead of the final cycle point #4543

Merged
merged 7 commits into from
Dec 7, 2021

Conversation

MetRonnie
Copy link
Member

@MetRonnie MetRonnie commented Dec 3, 2021

These changes partially address #4062

cylc play --stopcp=reload now does what it says - reload the value from [scheduling]stop after cycle point. (Previously it would use the value of the final cycle point)

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • Appropriate tests are included/updated (unit and functional).
  • Appropriate change log entry included.
  • (master branch) I have opened a documentation PR at Add docs for cycle point options in restart cylc-doc#362

Including remove unnecessary tests that cover the same functionality as other tests
It now takes value from `[scheduling]stop after cycle point` instead of the final cycle point
@MetRonnie MetRonnie added the could be better Not exactly a bug, but not ideal. label Dec 3, 2021
@MetRonnie MetRonnie added this to the cylc-8.0rc1 milestone Dec 3, 2021
@MetRonnie MetRonnie self-assigned this Dec 3, 2021
@@ -53,35 +51,3 @@ for SCP in 1 2 3; do
done

purge

# Gregorian Cycling
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to check this for different cycling types; it should be the responsibility of the tests/unit/cycling and tests/functional/cyclers tests to ensure cycle point comparison works

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# Test restart with stop point
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This covered the same stuff as tests/functional/restart/08-stop-after-cycle-point.t

Comment on lines -689 to -691
if self.config.start_point is None:
# No start cycle point at which to load cycling tasks.
continue
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this condition is no longer possible. And L691 showing as never hit in code coverage: https://app.codecov.io/gh/cylc/cylc-flow/blob/master/cylc/flow/scheduler.py

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked in practice. Confirmed I can't get it to be true.

Comment on lines -711 to -713
if self.options.startcp:
self.config.start_point = TaskID.get_standardised_point(
self.options.startcp)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unnecessary as duplication of

def process_start_cycle_point(self) -> None:
"""Set the start cycle point from options.
Sets:
self.options.startcp
self.start_point
"""
startcp = getattr(self.options, 'startcp', None)
starttask = getattr(self.options, 'starttask', None)
if startcp is not None and starttask is not None:
raise UserInputError(
"--start-cycle-point and --start-task are mutually exclusive"
)
if startcp:
# Start from a point later than initial point.
if self.options.startcp == 'now':
self.options.startcp = get_current_time_string()
self.start_point = get_point(self.options.startcp).standardise()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm looks reasonable.

Comment on lines -1128 to -1131
if not self.config.initial_point and not self.is_restart:
LOG.warning('No initial cycle point provided - no cycling tasks '
'will be loaded.')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again pretty sure this condition is no longer possible (config.initial_point should be set by this point)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legit.

Comment on lines -1162 to 1155
if self.is_restart and self.options.icp == 'reload':
LOG.debug(f"- initial point = {value} (ignored)")
elif self.options.icp is None:
self.options.icp = value
LOG.info(f"+ initial point = {value}")
self.options.icp = value
LOG.info(f"+ initial point = {value}")
elif key in self.workflow_db_mgr.KEY_START_CYCLE_POINT_COMPATS:
Copy link
Member Author

@MetRonnie MetRonnie Dec 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since #4313, initial and start cycle points cannot change on restart. But still need to set self.options.icp/startcp from DB as they are used later to set self.config.initial_point/start_point.

cylc/flow/scheduler.py Outdated Show resolved Hide resolved
Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Read, looks reasonable.
  • Checked to see if I can trigger conditions removed as surplus to reqs.

Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>
Copy link
Member

@hjoliver hjoliver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MetRonnie - good to have this confusing mess cleared up!

@hjoliver hjoliver merged commit 9a3d5b6 into cylc:master Dec 7, 2021
@MetRonnie MetRonnie deleted the stopcp branch December 7, 2021 10:21
@MetRonnie MetRonnie linked an issue Dec 8, 2021 that may be closed by this pull request
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
could be better Not exactly a bug, but not ideal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-evaluate the --initial/final/start/stop-cycle-point options for restarts
3 participants