Skip to content

Commit 1644a53

Browse files
Migrate to GW Python v3.12 environment on WCOSS2 (#4007)
This migrates the global workflow to the NCO-installed global-workflow-specific Python environment on WCOSS2. Note that to make this work, the path to the clone of `wxflow` needs to prepend that of the virtual environment as the VE has a slightly older, fixed version of wxflow. Resolves #2124
1 parent 927d53d commit 1644a53

File tree

10 files changed

+54
-13
lines changed

10 files changed

+54
-13
lines changed

dev/ush/gw_setup.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ fi
2929

3030
# Set up the PYTHONPATH to include wxflow from HOMEgfs
3131
if [[ -d "${HOMEgfs}/sorc/wxflow/src" ]]; then
32-
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src"
32+
PYTHONPATH="${HOMEgfs}/sorc/wxflow/src${PYTHONPATH:+:${PYTHONPATH}}"
3333
export PYTHONPATH
3434
fi
3535

36+
3637
if [[ ${unset_homegfs} == "YES" ]]; then
3738
unset HOMEgfs
3839
fi

dev/ush/load_gw_run_modules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fi
8282

8383
# Set up the PYTHONPATH to include wxflow from HOMEgfs
8484
if [[ -d "${HOMEgfs}/sorc/wxflow/src" ]]; then
85-
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src"
85+
PYTHONPATH="${HOMEgfs}/sorc/wxflow/src${PYTHONPATH:+:${PYTHONPATH}}"
8686
fi
8787

8888
# Add HOMEgfs/ush/python to PYTHONPATH

dev/ush/load_gw_verif_modules.sh

100644100755
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ fi
5656
module use "${HOMEgfs}/modulefiles"
5757

5858
case "${MACHINE_ID}" in
59-
"wcoss2")
60-
target_module="gw_run.${MACHINE_ID}"
61-
;;
62-
"hera")
59+
"wcoss2" | "hera")
6360
target_module="gw_verif.${MACHINE_ID}"
6461
;;
6562
*)

dev/ush/load_ufsda_modules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pip list
8080

8181
# Set up the PYTHONPATH to include wxflow from HOMEgfs
8282
if [[ -d "${HOMEgfs}/sorc/wxflow/src" ]]; then
83-
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src"
83+
PYTHONPATH="${HOMEgfs}/sorc/wxflow/src${PYTHONPATH:+:${PYTHONPATH}}"
8484
fi
8585

8686
# Add HOMEgfs/ush/python to PYTHONPATH

dev/ush/load_ufswm_modules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ unset MACHINE_ID
4040

4141
# Set up the PYTHONPATH to include wxflow from HOMEgfs
4242
if [[ -d "${HOMEgfs}/sorc/wxflow/src" ]]; then
43-
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/wxflow/src"
43+
PYTHONPATH="${HOMEgfs}/sorc/wxflow/src${PYTHONPATH:+:${PYTHONPATH}}"
4444
fi
4545

4646
# Add HOMEgfs/ush/python to PYTHONPATH

dev/workflow/rocoto/workflow_xml.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import os
44
import stat
5-
from distutils.spawn import find_executable
65
from datetime import datetime
76
from collections import OrderedDict
87
from typing import Dict
@@ -157,11 +156,13 @@ def _write_crontab(self, crontab_file: str = None, cronint: int = 5) -> None:
157156
"""
158157

159158
# No point creating a crontab if rocotorun is not available.
160-
rocotoruncmd = find_executable('rocotorun')
161-
if rocotoruncmd is None:
159+
rocotorun = which('rocotorun')
160+
if rocotorun is None:
162161
print('Failed to find rocotorun, crontab will not be created')
163162
return
164163

164+
rocotoruncmd = rocotorun.command
165+
165166
rocotorunstr = f'{rocotoruncmd} -d {self.expdir}/{self.pslot}.db -w {self.expdir}/{self.pslot}.xml'
166167
cronintstr = f'*/{cronint} * * * *'
167168

modulefiles/gw_run.wcoss2.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ load(pathJoin("cfp", (os.getenv("cfp_ver") or "None")))
1111
setenv("USE_CFP","YES")
1212

1313
load(pathJoin("python", (os.getenv("python_ver") or "None")))
14+
prepend_path("MODULEPATH", "/apps/dev/modulefiles")
15+
load(pathJoin("ve","gw", (os.getenv("gw_ve_ver") or "None")))
16+
1417
load(pathJoin("gempak", (os.getenv("gempak_ver") or "None")))
1518
load(pathJoin("perl", (os.getenv("perl_ver") or "None")))
1619
load(pathJoin("libjpeg", (os.getenv("libjpeg_ver") or "None")))

modulefiles/gw_setup.wcoss2.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ prepend_path("MODULEPATH", "/apps/ops/test/nco/modulefiles/core")
66
load(pathJoin("rocoto","1.3.5"))
77
load(pathJoin("PrgEnv-intel"))
88
load(pathJoin("intel","19.1.3.304"))
9-
load(pathJoin("python", "3.8.6"))
9+
load(pathJoin("python", "3.12.0"))
10+
11+
prepend_path("MODULEPATH", "/apps/dev/modulefiles")
12+
load(pathJoin("ve","gw","1.0"))
1013

1114
whatis("Description: GFS run setup environment")

modulefiles/gw_verif.wcoss2.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
help([[
2+
Load environment to run verification on WCOSS2
3+
]])
4+
5+
load(pathJoin("PrgEnv-intel", (os.getenv("PrgEnv_intel_ver") or "None")))
6+
load(pathJoin("craype", (os.getenv("craype_ver") or "None")))
7+
load(pathJoin("intel", (os.getenv("intel_ver") or "None")))
8+
load(pathJoin("cray-mpich", (os.getenv("cray_mpich_ver") or "None")))
9+
load(pathJoin("cray-pals", (os.getenv("cray_pals_ver") or "None")))
10+
load(pathJoin("cfp", (os.getenv("cfp_ver") or "None")))
11+
setenv("USE_CFP","YES")
12+
13+
-- Use Python 3.8.6 for verification
14+
load(pathJoin("python", '3.8.6'))
15+
16+
load(pathJoin("libjpeg", (os.getenv("libjpeg_ver") or "None")))
17+
18+
-- MET was build with these versions of HDF5 and netCDF
19+
load(pathJoin("hdf5", '1.10.6'))
20+
load(pathJoin("netcdf", '4.7.4'))
21+
22+
-- The cray library path for C MPI libraries (needed by C-only programs using netCDF)
23+
local cray_lib_path=os.getenv("CRAY_LD_LIBRARY_PATH") or ""
24+
prepend_path("LD_LIBRARY_PATH", cray_lib_path)
25+
26+
load(pathJoin("prod_util", (os.getenv("prod_util_ver") or "None")))
27+
load(pathJoin("grib_util", (os.getenv("grib_util_ver") or "None")))
28+
load(pathJoin("wgrib2", (os.getenv("wgrib2_ver") or "None")))
29+
30+
prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/compiler/intel/19.1.3.304")
31+
setenv("HPC_OPT", "/apps/ops/para/libs")
32+
load(pathJoin("met", (os.getenv("met_ver") or "None")))
33+
load(pathJoin("metplus", (os.getenv("metplus_ver") or "None")))
34+
35+
whatis("Description: Verification environment")

versions/run.wcoss2.ver

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export obsproc_ver=v1.1
99
export imagemagick_ver=7.0.8-7
1010
export cdo_ver=1.9.8
1111
export perl_ver=5.32.0
12-
export python_ver=3.8.6
12+
export python_ver=3.12.0
13+
export gw_ve_ver=1.0
1314
export gempak_ver=7.15.1
1415
export nco_ver=5.0.6
1516
export grib_util_ver=1.2.3

0 commit comments

Comments
 (0)