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

Get some unit testing defaults from config_machines #872

Closed
billsacks opened this issue Nov 30, 2016 · 1 comment
Closed

Get some unit testing defaults from config_machines #872

billsacks opened this issue Nov 30, 2016 · 1 comment
Assignees

Comments

@billsacks
Copy link
Member

From @billsacks on August 4, 2015 17:6

With the changes here:

CESM-Development#87

a number of machine-specific settings need to be explicitly specified when running run_tests.py; these should be obtained from config_machines:

  • mpilib
  • maybe the mpirun command
  • maybe the default compiler for a machine

@quantheory suggested this; he and @jedwards4b seem like the ones who would know how to do this.

Copied from original issue: CESM-Development#92

@billsacks
Copy link
Member Author

billsacks commented Apr 12, 2017

It looks like mpilib and compiler can pick up defaults now, although some tweaks are needed:

  • For mpilib: fix documentation of this argument in run_tests.py to say it's optional, and test to make sure it works

  • For compiler: get rid of the default in the parser.add_argument call: parser.add_argument("--compiler", default="gnu",, so that it defaults to None.

Ideally, the mpirun command would still be picked up by default. In addition, it would be nice if --use-openmp could be determined by default, maybe based on some new xml variable that says whether the pFUnit build requires openmp? But for now, maybe the easiest is to default to this being true, since that's the way we typically build pFUnit. Then could have a flag to set it to false, like --no-openmp.

@ghost ghost assigned billsacks Apr 13, 2017
@ghost ghost added the in progress label Apr 13, 2017
jedwards4b added a commit that referenced this issue Apr 13, 2017
Unit testing: Determine machine-specific settings automatically
This PR allows you to run the unit tests by simply running
tools/unit_testing/run_tests.py without any additional arguments. The
machine, compiler, mpilib, and mpirun command are now determined
automatically. In addition, use-openmp is now assumed by default, since
that is the standard way we build pFUnit (but there is a mechanism to
turn off use-openmp).

This is important in order to support unit testing on additional
machines.

In order to accomplish this, I needed to tweak some pieces that are also
used by system builds:

(1) I added a unit_testing attribute to the mpirun command in
config_machines.xml. This is needed on yellowstone, where we use a
complex command to launch CESM, but just want to use a simple
'mpirun.lsf' to launch unit tests.

(2) In machines.py: probe_machine_name: If no name is found with
socket.getfqdn(), then try socket.gethostname(). This is needed in
order to determine the machine when running on my laptop.

Test suite: scripts_regression_tests on yellowstone
Also ran unit tests on yellowstone using the trimmed-down command
documented in README.unit_testing. And ran unit tests on my laptop
using the same command.
Test baseline: N/A
Test namelist changes: none
Test status: bit for bit

Fixes #872

User interface changes?: Simplifies the typical call to run_tests.py

Code review: jedwards
@ghost ghost removed the in progress label Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants