From f0c037dbed6a414b75a518f6d92c2012ba1a0397 Mon Sep 17 00:00:00 2001 From: Biju Thomas Date: Fri, 16 Aug 2024 12:33:09 -0400 Subject: [PATCH] Enable Gaea C6 support for hafs_gsi --- modulefiles/gsi_gaeaC6.intel.lua | 56 ++++++++++++++++++++++++++++++++ ush/detect_machine.sh | 7 +++- ush/module-setup.sh | 23 +++++++------ 3 files changed, 75 insertions(+), 11 deletions(-) create mode 100644 modulefiles/gsi_gaeaC6.intel.lua diff --git a/modulefiles/gsi_gaeaC6.intel.lua b/modulefiles/gsi_gaeaC6.intel.lua new file mode 100644 index 0000000000..0509a45d0d --- /dev/null +++ b/modulefiles/gsi_gaeaC6.intel.lua @@ -0,0 +1,56 @@ +help([[ +]]) + +prepend_path("MODULEPATH", "/autofs/ncrc-svm1_proj/epic/spack-stack/spack-stack-1.6.0/envs/unified-env-c6/install/modulefiles/Core") + +local python_ver=os.getenv("python_ver") or "3.10.13" +local stack_intel_ver=os.getenv("stack_intel_ver") or "2023.2.0" +local stack_mpich_ver=os.getenv("stack_mpich_ver") or "8.1.29" +local cmake_ver=os.getenv("cmake_ver") or "3.23.1" +local prod_util_ver=os.getenv("prod_util_ver") or "2.1.1" + +load(pathJoin("stack-intel", stack_intel_ver)) +load(pathJoin("stack-cray-mpich", stack_mpich_ver)) +load(pathJoin("python", python_ver)) +load(pathJoin("cmake", cmake_ver)) +load(pathJoin("prod_util", prod_util_ver)) + + +local netcdf_c_ver=os.getenv("netcdf_c_ver") or "4.9.2" +local netcdf_fortran_ver=os.getenv("netcdf_fortran_ver") or "4.6.1" + +local bufr_ver=os.getenv("bufr_ver") or "12.0.1" +local bacio_ver=os.getenv("bacio_ver") or "2.4.1" +local w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" +local sp_ver=os.getenv("sp_ver") or "2.5.0" +local ip_ver=os.getenv("ip_ver") or "4.3.0" +local sigio_ver=os.getenv("sigio_ver") or "2.3.2" +local sfcio_ver=os.getenv("sfcio_ver") or "1.4.1" +local nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" +local wrf_io_ver=os.getenv("wrf_io_ver") or "1.2.0" +local ncio_ver=os.getenv("ncio_ver") or "1.1.2" +local crtm_ver=os.getenv("crtm_ver") or "2.4.0.1" +local ncdiag_ver=os.getenv("ncdiag_ver") or "1.1.2" + +load(pathJoin("netcdf-c", netcdf_c_ver)) +load(pathJoin("netcdf-fortran", netcdf_fortran_ver)) + +load(pathJoin("bufr", bufr_ver)) +load(pathJoin("bacio", bacio_ver)) +load(pathJoin("w3emc", w3emc_ver)) +load(pathJoin("sp", sp_ver)) +load(pathJoin("ip", ip_ver)) +load(pathJoin("sigio", sigio_ver)) +load(pathJoin("sfcio", sfcio_ver)) +load(pathJoin("nemsio", nemsio_ver)) +load(pathJoin("wrf-io", wrf_io_ver)) +load(pathJoin("ncio", ncio_ver)) +load(pathJoin("crtm", crtm_ver)) +load(pathJoin("gsi-ncdiag",ncdiag_ver)) + +--pushenv("CFLAGS", "-axSSE4.2,AVX,CORE-AVX2") +--pushenv("FFLAGS", "-axSSE4.2,AVX,CORE-AVX2") + +pushenv("GSI_BINARY_SOURCE_DIR", "/mnt/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/gsi/20230911") + +whatis("Description: GSI environment on Gaea with Intel Compilers") diff --git a/ush/detect_machine.sh b/ush/detect_machine.sh index 0beb937f7e..acc682a8c5 100755 --- a/ush/detect_machine.sh +++ b/ush/detect_machine.sh @@ -43,6 +43,8 @@ case $(hostname -f) in discover3[1-5].prv.cube) MACHINE_ID=discover ;; ### discover31-35 *) MACHINE_ID=UNKNOWN ;; # Unknown platform + + gaea6[1-8].ncrc.gov) MACHINE_ID=gaeaC6 ;; ### Gaea C6 61-68 esac if [[ ${MACHINE_ID} == "UNKNOWN" ]]; then @@ -81,9 +83,12 @@ elif [[ -d /work ]]; then else MACHINE_ID=orion fi -elif [[ -d /gpfs && -d /ncrc ]]; then +elif [[ -d /gpfs/f5 && -d /ncrc ]]; then # We are on GAEA. MACHINE_ID=gaea +elif [[ -d /gpfs/f6 && -d /ncrc ]]; then + # We are on GAEA C6. + MACHINE_ID=gaeaC6 elif [[ -d /data/prod ]]; then # We are on SSEC's S4 MACHINE_ID=s4 diff --git a/ush/module-setup.sh b/ush/module-setup.sh index 299e13aa4e..3fbb615c06 100755 --- a/ush/module-setup.sh +++ b/ush/module-setup.sh @@ -49,16 +49,19 @@ elif [[ $MACHINE_ID = stampede* ]] ; then elif [[ $MACHINE_ID = gaea* ]] ; then # We are on GAEA. - if ( ! eval module help > /dev/null 2>&1 ) ; then - # We cannot simply load the module command. The GAEA - # /etc/profile modifies a number of module-related variables - # before loading the module command. Without those variables, - # the module command fails. Hence we actually have to source - # /etc/profile here. - source /etc/profile - fi - module reset - + if [[ $MACHINE_ID = gaeaC6 ]]; then + source /opt/cray/pe/lmod/8.7.31/init/sh + else + if ( ! eval module help > /dev/null 2>&1 ) ; then + # We cannot simply load the module command. The GAEA + # /etc/profile modifies a number of module-related variables + # before loading the module command. Without those variables, + # the module command fails. Hence we actually have to source + # /etc/profile here. + source /etc/profile + fi + fi + module reset elif [[ $MACHINE_ID = expanse* ]]; then # We are on SDSC Expanse if ( ! eval module help > /dev/null 2>&1 ) ; then