Skip to content

Conversation

@xylar
Copy link
Collaborator

@xylar xylar commented May 14, 2020

Several ocean test cases depend on other ocean test cases. Currently, this is used to create a mesh and/or initial condition that are then reused by one or more other tests.

Currently, the user simply must make sure the prerequisites are present when setting up a test case. However, this merge makes sure that prerequisites are always present a regression suite and that they run before the dependent test case. The main motivation for this change is future support for running multiple test cases from the nightly test suite in parallel.

This is done by parsing a tag like the following example from a config_driver.xml for the dependent test case:

<prerequisite core="ocean" configuration="global_ocean" resolution="QU240" test="init"/>

These tags will be added to individual test cases in separate PRs to the individual <core>/develop branches.

xylar added 5 commits May 14, 2020 10:36
This merge makes a dict of test cases, each with a dict of info:
core, configuration, resolution, test, procs and treads.

This will be useful later on in both determining whether
prerequisite tasks are present and in determining how to run
many tests in parallel
Make sure they are also in the test suite
This prevents variables being in global scope that we may not
want.


def process_test_clean(test_tag, work_dir, suite_script): # {{{
def process_test_clean(test_tag, work_dir): # {{{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just clean-up of an unused argument

Comment on lines -420 to +459
if __name__ == "__main__":
def main (): # {{{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Making main() a function to avoid having module-level variables (sometimes prevents bugs).

args.work_dir + '/manage_regression_suite.py.out']
print('\nCase setup output:')
print(subprocess.check_output(cmd))
print(subprocess.check_output(cmd).decode('utf-8'))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This looks like garbage in python 3 without the decode

Comment on lines +537 to +540
testcases = get_test_case_procs(suite_root)
setup_suite(suite_root, args.work_dir, args.model_runtime,
args.config_file, args.baseline_dir, args.verbose)
summarize_suite(suite_root)
summarize_suite(testcases)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The changes require doing the parsing that was previously in summarize_suite() before doing setup_suite() so we can error out if the prerequisites are not present. The info from this parsing is stored in nested dicts that will likely be useful for future efforts for parallelization.

@xylar
Copy link
Collaborator Author

xylar commented May 14, 2020

@mark-petersen, @matthewhoffman, and @pwolfram, this is work that feeds into work that @jamilgafur is doing, supervised by @vanroekel and me, toward paralleling regression test suites. For that work, it will be important to know which test cases must run before which others, and which can run in parallel.

@xylar
Copy link
Collaborator Author

xylar commented May 14, 2020

@matthewhoffman, I'm mostly wanting to make sure you are okay with these changes, and to have you run a quick test of your regression suite(s) with these changes to make sure nothing breaks.

@xylar
Copy link
Collaborator Author

xylar commented May 14, 2020

@mark-petersen, the easiest way to test this would be to copy this version of manage_regression_suite.py into the right place in #560 and run the nightly regression suite (and any others that are affected by prerequisites). This worked well for me on my laptop, but I will also test on LANL IC as soon as I can.

@xylar xylar removed the request for review from pwolfram May 14, 2020 08:59
@xylar
Copy link
Collaborator Author

xylar commented May 14, 2020

@jamilgafur and @vanroekel, I would definitely appreciate your feedback, too, particularly since this work is mainly supposed to help with the parallelization that @jamilgafur is working on.

@pwolfram
Copy link
Contributor

@xylar, just to be clear here-- you need this tag to build a dependency graph so you can execute in parallel, right? Basically, something like if there is a prerequisite and it isn't fulfilled, move case to bottom of queue and if only one item in queue report error.

@xylar
Copy link
Collaborator Author

xylar commented May 14, 2020

@pwolfram, yep, that's the idea. Since we don't typically run in parallel, I'm just checking to see that any prerequisites are already in the list of test cases to run when a new test case gets added, because otherwise serial execution gets broken. In parallel, one approach would be what you suggest.

@vanroekel
Copy link
Contributor

@xylar Just a FYI that @jamilgafur has merged this to his local branch for testing the parallel nightly regression. After that test, I will approve. If you'd prefer me to approve sooner, let me know and I can look more closely at the code itself to approve.

@xylar
Copy link
Collaborator Author

xylar commented May 18, 2020

@vanroekel, no rush. My guess is that this won't go in particularly soon, so @jamilgafur should test as much as needed.

Copy link
Contributor

@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.

Merged #559 and #560 locally, set up and ran nightly regression suite successfully. Removed init set from nightly regression and got the expected error (#560 (review)).

This can be merged into develop any time.

@xylar
Copy link
Collaborator Author

xylar commented Jun 3, 2020

@vanroekel, what is the order of merging this vs #593? I had thought this would get approved and merged before too much work went into #593.

@vanroekel
Copy link
Contributor

sorry @xylar I meant to come back and approve this. I will approve now as it works great in our testing. then we'll rebase #593.

Copy link
Contributor

@vanroekel vanroekel left a comment

Choose a reason for hiding this comment

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

this has worked great in testing with @jamilgafur.

@xylar
Copy link
Collaborator Author

xylar commented Jun 3, 2020

Great, thanks @vanroekel!

@xylar xylar merged commit 0fda9ab into MPAS-Dev:develop Jun 4, 2020
@xylar xylar deleted the compass/add_prerequisite_tag branch June 4, 2020 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants