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

Alter steps_to_run in config file or command line #104

Merged
merged 6 commits into from
Jun 4, 2021

Conversation

xylar
Copy link
Collaborator

@xylar xylar commented Apr 30, 2021

This merge adds the ability for users to choose which steps in a test case they want to run. They have 2 options.

First, they can alter the steps_to_run config option in the test_case section at the very top of the test case's config file:

[test_case]
steps_to_run = initial_state full_run restart_run

The list of steps_to_run can be separated by spaces, commas or both.

Or they can specify which steps to run (or which steps not to run) via the --steps (or --no-steps) flag to compass run:

python -m compass run --steps initial_state full_run
python -m compass run --no-steps restart_run

Both of these accomplish the same thing -- skipping the restart_run step of the test case.

The new capability has been added to the documentation.

closes #80

@xylar xylar added enhancement New feature or request ocean labels Apr 30, 2021
@xylar xylar self-assigned this Apr 30, 2021
@xylar xylar added this to In progress in compass 1.0 via automation Apr 30, 2021
@xylar
Copy link
Collaborator Author

xylar commented Apr 30, 2021

Testing

I have run the nightly test suite on Ubuntu with gnu, and everything passed and is bit-for-bit with master from earlier today.

I also verified that I could modify the config option steps_to_run and only the desired steps ran. Similarly, I verified that I could both explicitly include steps with the --steps flag and exclude them with the --no-steps flag. I verified that these flags have no effect when calling compass run to run a suite or within a step work directory.

@xylar
Copy link
Collaborator Author

xylar commented Apr 30, 2021

@mark-petersen requested something like this in #80. This is my suggestion.

@mark-petersen and @matthewhoffman, if you are willing to review, I would appreciate a little testing. And please let me know if you are happy with this solution or if you have alternative suggestions or changes.

@xylar xylar added python package DEPRECATED: PRs and Issues involving the python package (master branch) and removed ocean labels May 4, 2021
@mark-petersen
Copy link
Collaborator

I tested this at a test case level and it works, both with flags and *.cfg file. Thanks, that is handy!

One of my common workflows is to run the full nightly regression suite once, then rerun it with other compilers or debug, openmp settings, but turn off the QU240 mesh and init to save time. Is there a way to do that? I think this PR does not address omitting a test case from a suite altogether.

I tried it with this functionality, ie

vi ocean/global_ocean/QU240/mesh/mesh.cfg
steps_to_run =

with a blank, but it ran that step anyway. The suite function must override the config setting.

@xylar
Copy link
Collaborator Author

xylar commented May 10, 2021

@mark-petersen,

One of my common workflows is to run the full nightly regression suite once, then rerun it with other compilers or debug, openmp settings, but turn off the QU240 mesh and init to save time. Is there a way to do that? I think this PR does not address omitting a test case from a suite altogether.

My suggestion would be to make version of the nightly suite with and without the test you don't want to run. I can't think of any way to efficiently specify that you don't want to run a particular step but you could open an issue with a suggested method for doing that.

I tried it with this functionality, ie
...
with a blank, but it ran that step anyway. The suite function must override the config setting.

Hmm, I can look into that. If steps_to_run isn't getting processed during test-suite runs, that isn't intentional. I'll get back to you..

@xylar
Copy link
Collaborator Author

xylar commented May 12, 2021

@mark-petersen, indeed, steps_to_run wasn't getting parsed for test cases run out of a test suite. I have fixed this now and run the nightly suite once with with mesh step and once without it, as you suggested. It worked for me. Could you verify that it works for you?

Please also comment on #114 so I can make sure to address your needs there.

Copy link
Member

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

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

@xylar , this looks great. I added inline comments for the 2 items we discussed on the phone.

python -m compass run --no-steps restart_run

Would both accomplish the same thing in this example -- skipping the
``restart_run`` step of the test case.
Copy link
Member

Choose a reason for hiding this comment

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

Add note that using command line option will override the cfg version.

'steps_to_run').replace(',', ' ').split()

if steps_not_to_run is not None:
steps_to_run = [step for step in steps_to_run if step not in
Copy link
Member

Choose a reason for hiding this comment

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

Check if step name specified is actually a valid step name or not. (This should be done for both --steps and --no-steps.)

@xylar
Copy link
Collaborator Author

xylar commented May 25, 2021

@matthewhoffman, thank you for both of your excellent suggestions. I believe they are now addressed. Please give this another look when you have a chance.

Copy link
Collaborator

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for these improvements.

@xylar
Copy link
Collaborator Author

xylar commented Jun 4, 2021

@matthewhoffman, still waiting on a re-review here. Is that something you can do soon?

xylar added 6 commits June 4, 2021 09:09
This will be at the top of the config file for every test case
and will contain the default steps to run, which the user can
then alter before running the test case.
These are used to explictly run (or not run) steps in the test
case.
When a bad step name is given to the `steps_to_run` config
option or the `--steps` or `--no-step` command-line flags, an
error is raised.
@matthewhoffman
Copy link
Member

I'm looking at this again now. I got myself confused because I hadnt realized it was rebased on the dev env.

@matthewhoffman matthewhoffman self-requested a review June 4, 2021 16:23
Copy link
Member

@matthewhoffman matthewhoffman left a comment

Choose a reason for hiding this comment

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

Looks good @xylar. Thanks for adding the additional error-checking. I tried all the ways of asking it to do incorrect things, and it gave sensible errors each time.

@xylar
Copy link
Collaborator Author

xylar commented Jun 4, 2021

Thanks!

@xylar xylar merged commit 5ab0531 into MPAS-Dev:master Jun 4, 2021
compass 1.0 automation moved this from In progress to Done Jun 4, 2021
@xylar xylar deleted the alter_steps_to_run branch June 4, 2021 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request python package DEPRECATED: PRs and Issues involving the python package (master branch)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Ability to view and alter steps within run command
3 participants