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

Move plumber2 scripts to python directory #2503

Closed
wants to merge 16 commits into from

Conversation

TeaganKing
Copy link
Contributor

@TeaganKing TeaganKing commented May 1, 2024

Description of changes

This PR addresses @2187 by moving new scripts that were added in #2155 to tools/site_and_regional into the python directory, similarly to other NEON scripts in #2156.

Fixed: #2187

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? No

Testing performed, if any:
I tested newly added unit test, which was successful, with python -m unittest test_unit_plumber2_surf_wrapper.py. I will add that when testing with ./run_ctsm_py_tests -u, I ran into a seemingly unrelated error that I'll add in a comment below.

@TeaganKing TeaganKing self-assigned this May 1, 2024
@TeaganKing
Copy link
Contributor Author

TeaganKing commented May 1, 2024

Here is the probably unrelated error in testing that I mentioned above:

./run_ctsm_py_tests -u
...........................................E
Stdout:
ERROR while running:
/glade/work/tking/ctsm_2187/CTSM/cime/CIME/scripts/configure --macros-format CMake --silent --compiler intel --machine derecho
From /glade/derecho/scratch/tking/tmp/tmp86u2eboo/tools_bld

ERROR: module command /glade/u/apps/casper/23.10/spack/opt/spack/lmod/8.7.24/gcc/7.5.0/m4jx/lmod/lmod/libexec/lmod python load craype intel/2023.2.1 mkl ncarcompilers/1.0.0 cmake cray-mpich/8.1.27 netcdf-mpi/4.9.2 parallel-netcdf/1.12.3 parallelio/2.6.2 esmf/8.6.0 failed with message:
Lmod has detected the following error: The following module(s) are unknown: "craype"

Please check the spelling or version number. Also try "module spider ..."
It is also possible your cache file is out-of-date; it may help to try:
  $ module --ignore_cache load "craype"

Also make sure that all modulefiles written in TCL start with the string #%Module


...............................................................................................................................................................
======================================================================
ERROR: test_derecho_mpirun (test.test_unit_gen_mksurfdata_jobscript_single.TestFGenMkSurfJobscriptSingle)
test derecho mpirun. This would've helped caught a problem we ran into
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/glade/work/tking/ctsm_2187/CTSM/python/ctsm/os_utils.py", line 21, in run_cmd_output_on_error
    _ = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True, cwd=cwd)
  File "/glade/u/home/tking/.conda/envs/ctsm_pylib/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/glade/u/home/tking/.conda/envs/ctsm_pylib/lib/python3.7/subprocess.py", line 512, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/glade/work/tking/ctsm_2187/CTSM/cime/CIME/scripts/configure', '--macros-format', 'CMake', '--silent', '--compiler', 'intel', '--machine', 'derecho']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/glade/work/tking/ctsm_2187/CTSM/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py", line 161, in test_derecho_mpirun
    cmd=cmd_list, errmsg="Trouble running configure", cwd=self._bld_path
  File "/glade/work/tking/ctsm_2187/CTSM/python/ctsm/os_utils.py", line 30, in run_cmd_output_on_error
    abort(errmsg)
  File "/glade/work/tking/ctsm_2187/CTSM/python/ctsm/utils.py", line 26, in abort
    sys.exit("ERROR: {}".format(errmsg))
SystemExit: ERROR: Trouble running configure

Stdout:
ERROR while running:
/glade/work/tking/ctsm_2187/CTSM/cime/CIME/scripts/configure --macros-format CMake --silent --compiler intel --machine derecho
From /glade/derecho/scratch/tking/tmp/tmp86u2eboo/tools_bld

ERROR: module command /glade/u/apps/casper/23.10/spack/opt/spack/lmod/8.7.24/gcc/7.5.0/m4jx/lmod/lmod/libexec/lmod python load craype intel/2023.2.1 mkl ncarcompilers/1.0.0 cmake cray-mpich/8.1.27 netcdf-mpi/4.9.2 parallel-netcdf/1.12.3 parallelio/2.6.2 esmf/8.6.0 failed with message:
Lmod has detected the following error: The following module(s) are unknown: "craype"

Please check the spelling or version number. Also try "module spider ..."
It is also possible your cache file is out-of-date; it may help to try:
  $ module --ignore_cache load "craype"

Also make sure that all modulefiles written in TCL start with the string #%Module



----------------------------------------------------------------------

@ekluzek
Copy link
Collaborator

ekluzek commented May 1, 2024

@TeaganKing thanks for working on bringing this in.

A small formatting suggestion for PR's and issues. When you have test results that come in, it'll format it weirdly naturally. But, if you highlight and make it code with the "<>" option above the comment it'll look more normal.

@TeaganKing
Copy link
Contributor Author

TeaganKing commented May 1, 2024

Thanks @ekluzek . I had pressed '<>' before adding the code, and it's certainly not a one-line bit of code, so the single quotes didn't work as I intended-- I fixed that though :)

I think I also must have not set up merging into b4b dev correctly, as this is also pulling in changes from you and Gregory? I'm assuming these changes should go into b4b dev before master?

@ekluzek
Copy link
Collaborator

ekluzek commented May 1, 2024

@TeaganKing I'm thinking you just need to merge in the latest escomp/b4b-dev. Fetch and then do that and it should clean that up. If not we'll need to figure that out.

One other suggestion is that you make sure the issues fixed are on it's own line with a "fixed" in front of it. That will it will know to autoclose the issue. This is something we should make more obvious in the PR template.

@TeaganKing
Copy link
Contributor Author

This is now being done in #2505 so that it is off of the correct branch... closing this PR.

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

Successfully merging this pull request may close these issues.

Move new PLUMBER2 scripts to python directory to enable python testing
3 participants