-
Notifications
You must be signed in to change notification settings - Fork 164
Portable MOM6-examples testing #515
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
Conversation
de19e5c to
9160a2f
Compare
|
I extended this to the ice_ocean_SIS2 tests, and also fixed a few issues exposed by those tests. Let me try to extend this to the coupled AM2 tests before reviewing. |
9160a2f to
200e439
Compare
|
I added some more:
I think this is ready now, although I always end up finding surprises. |
|
I'll try this out shortly, but I notice we have a |
|
Each of the submakes has a |
e233b4f to
00b0afb
Compare
|
I added a top-level
|
|
There are issues with the
There are a few fixes, but one possibility is to define top-level (Also remember AM2-coupled needs FMS1, so both FMS libs should have been listed as dependencies. This was a flat-out error in the top Makefile.) Other minor stuff:
|
5f85dbb to
2367611
Compare
|
The top Makefile was updated to support a I did this by adding But overall this appears to work now, and no changes to the submakes was needed. |
2367611 to
32dcf8a
Compare
|
New updates to run and test rules, to use the new dependency decorators. Also pretty colors to the test diff output. |
|
Yet another issue: This works if Seems like rules (and the funny Taking one more crack at the problem... |
4936e4f to
0a1b08a
Compare
|
New version creates |
82e7b95 to
d9bcd82
Compare
This script parses a MOM parameter file and can be used as either a Python module or a command line tool. If used as a module, it returns a dict of all Python parameters. AFAIK nearly everything is supported, including blocks and repeat tokens (e.g. x = 5*1). Only A%B%C = 1 is not yet supported. As a command line tool, you can provide the file and a parameter and it will return the value. Probably won't work for blocks. I don't think there are any plans to use it as a CLI tool. The f90nml Python module was added as a submodule to support this and future support scripts.
The get_nprocs.sh script has been replaced with get_nprocs.py, a Python script which parses both MOM_parameter_doc.layout and input.nml to determine the total number of CPUs for a given experiment. The "maxiumum CPU limit" is now determined by the psutils Python module. It will only be used if the module is available. There is no true platform-independent or even POSIX way to determine the total CPU count, but psutil provides a way to do this on a variety of platforms - if it's available.
d9bcd82 to
017624a
Compare
This script is a command line too which attempts to generate the list of input files for a given experiment. Information is taken from both input.nml and MOM parameter files to reconstruct the list of input files, along with any expected FMS files. Any information in INPUT (or perhaps the param's INPUTDIR) is assumed to be a symbolic link and is moved over by the associated Makefile. This script is far from perfect, and it is perhaps impossible to ever create such a script, but it should be sufficient for this repo.
This adds multiple rules to the ocean_only Makefile for running
experiments and testing parameter output. This reflects existing
testing of MOM6-examples in the
See the Makefile header for a breakdown of the rules. The basic rules
are
make
Build the model
make run EXPT=exp RUNDIR=scratch
make exp.run
Run experiment `exp` in directory `scratch`.
If RUNDIR is omitted, run in-place.
make test EXPT=exp
Test the parameter output of `exp` against reference output.
make run.all
make test.all
Run all tests (with some exception)
Same as ocean_only, see prior commit.
Same as ocean_only, see prior commit.
This patch adds a `test` rule to the top Makefile, which runs `test.all` for each of the submodules. The build rules for each model are added as dependencies for the test rule, so that there is no attempt to concurrently build the identical components in separate submake processes.
The Gitlab configuration file is updated to use the new Makefile-based testing. Multiple tasks which were previously defined in tools/MRS/Makefile are moved into .gitlab-ci.yml. While still not a platform-independent setup, there is at least now a logical separation of the environment from the building and running of the models.
Replace Python script shell invocation and pass the scripts directly to the Python parser. This prevents reliance on the /usr/bin/env syntax. (For example, `python3` is the only available parser in some systems.) The PYTHON environment variable is also used to permit the environment to define the Python parser.
017624a to
34cfe68
Compare
An incomplete build (e.g. interrupted, or due to source code error) would lead to a rm *.o before re-building. Apparently I said this was ok, but I don't agree with my past self.
The use of a FORCE target was causing invocation of sub-make 4 levels deep all the way through to the build/fms Makefile which was invoked for every other sub-make target. This replaces FORCE with appropriate wildcard based on CODEBASE for each target. It works fine. While the wildcard might capture source code that is not actually compiled, it does no harm making it a dependency in the higher level Makefiles.
- Changed `make -j test.all` to `make -k test.all` to get all changes - Changed dependency for test.% to run.% to help with one-stop-shop - The test otherwise depended on just the executable
|
Improvements from @adcroft
|
This PR modifies the
ocean_onlyMakefile to support automated running and testing of the MOM6-examples test suite.Currently it only replicates the existing Gitlab testing, which validates the input parameter (
MOM_parameter_doc.*) and diagnostics (available_diags*) output. But the testing theTwo support scripts have been added:
parse_mom_input.py: Command line tool that returns the value of aMOM_inputparameter. It can also be used to convert the parameter file to a Python dict.get_input_manifest.py: Generate a list of input files used byThe
f90nmlPython module has also been added as a git submodule forget_input_manifest.py.This was set up for "normal" systems, so it does not work out-of-the-box on Gaea. Additional MPI configuration is required.