From 98038caa544d6a77b80d1b564427aaa4efff67b0 Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 2 May 2022 11:59:30 +0000 Subject: [PATCH 1/2] change env to mod --- ush/config_defaults.sh | 12 ++++++------ ush/config_defaults.yaml | 12 ++++++------ ush/launch_FV3LAM_wflow.sh | 8 ++++---- ush/load_modules_run_task.sh | 15 ++++++++------- ush/setup.py | 8 ++++---- ush/setup.sh | 6 +++--- 6 files changed, 31 insertions(+), 30 deletions(-) diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index ba57dca9d..aa6cddc36 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -73,12 +73,12 @@ RUN_ENVIR="nco" # Path to the LMOD sh file on your Linux system. Is set automatically # for supported machines. # -# BUILD_ENV_FN: -# Name of alternative build environment file to use if using an +# BUILD_MOD_FN: +# Name of alternative build module file to use if using an # unsupported platform. Is set automatically for supported machines. # -# WFLOW_ENV_FN: -# Name of alternative workflow environment file to use if using an +# WFLOW_MOD_FN: +# Name of alternative workflow module file to use if using an # unsupported platform. Is set automatically for supported machines. # # SCHED: @@ -142,8 +142,8 @@ ACCOUNT="project_name" WORKFLOW_MANAGER="none" NCORES_PER_NODE="" LMOD_PATH="" -BUILD_ENV_FN="" -WFLOW_ENV_FN="" +BUILD_MOD_FN="" +WFLOW_MOD_FN="" SCHED="" PARTITION_DEFAULT="" QUEUE_DEFAULT="" diff --git a/ush/config_defaults.yaml b/ush/config_defaults.yaml index ac3552953..a2a218a7f 100644 --- a/ush/config_defaults.yaml +++ b/ush/config_defaults.yaml @@ -73,12 +73,12 @@ RUN_ENVIR: "nco" # Path to the LMOD sh file on your Linux system. Is set automatically # for supported machines. # -# BUILD_ENV_FN: -# Name of alternative build environment file to use if using an +# BUILD_MOD_FN: +# Name of alternative build module file to use if using an # unsupported platform. Is set automatically for supported machines. # -# WFLOW_ENV_FN: -# Name of alternative workflow environment file to use if using an +# WFLOW_MOD_FN: +# Name of alternative workflow module file to use if using an # unsupported platform. Is set automatically for supported machines. # # SCHED: @@ -142,8 +142,8 @@ ACCOUNT: "project_name" WORKFLOW_MANAGER: "none" NCORES_PER_NODE: "" LMOD_PATH: "" -BUILD_ENV_FN: "" -WFLOW_ENV_FN: "" +BUILD_MOD_FN: "" +WFLOW_MOD_FN: "" SCHED: "" PARTITION_DEFAULT: "" QUEUE_DEFAULT: "" diff --git a/ush/launch_FV3LAM_wflow.sh b/ush/launch_FV3LAM_wflow.sh index ddee812fa..0971d5a89 100755 --- a/ush/launch_FV3LAM_wflow.sh +++ b/ush/launch_FV3LAM_wflow.sh @@ -149,11 +149,11 @@ expt_name="${EXPT_SUBDIR}" # #----------------------------------------------------------------------- # -env_fp="${SR_WX_APP_TOP_DIR}/env/${WFLOW_ENV_FN}" -source "${env_fp}" || print_err_msg_exit "\ -Sourcing platform-specific environment file (env_fp) for the workflow +module use "${SR_WX_APP_TOP_DIR}/modulefiles" +module load "${WFLOW_MOD_FN}" || print_err_msg_exit "\ +Loading platform-specific module file (WFLOW_MOD_FN) for the workflow task failed: - env_fp = \"${env_fp}\"" + WFLOW_MOD_FN = \"${WFLOW_MOD_FN}\"" # #----------------------------------------------------------------------- # diff --git a/ush/load_modules_run_task.sh b/ush/load_modules_run_task.sh index 56c005faa..7a9547fe0 100755 --- a/ush/load_modules_run_task.sh +++ b/ush/load_modules_run_task.sh @@ -86,18 +86,19 @@ jjob_fp="$2" # #----------------------------------------------------------------------- # -# Sourcing ufs-srweather-app build env file +# Loading ufs-srweather-app build module files # #----------------------------------------------------------------------- # machine=$(echo_lowercase $MACHINE) -env_fp="${SR_WX_APP_TOP_DIR}/env/${BUILD_ENV_FN}" -module use "${SR_WX_APP_TOP_DIR}/env" -source "${env_fp}" || print_err_msg_exit "\ -Sourcing platform- and compiler-specific environment file (env_fp) for the + +source "${SR_WX_APP_TOP_DIR}/etc/lmod-setup.sh" +module use "${SR_WX_APP_TOP_DIR}/modulefiles" +module load "${BUILD_MOD_FN}" || print_err_msg_exit "\ +Sourcing platform- and compiler-specific module file (BUILD_MOD_FN) for the workflow task specified by task_name failed: task_name = \"${task_name}\" - env_fp = \"${env_fp}\"" + BUILD_MOD_FN = \"${BUILD_MOD_FN}\"" # #----------------------------------------------------------------------- # @@ -112,7 +113,7 @@ workflow task specified by task_name failed: # # The regional_workflow repository contains module files for the # workflow tasks in the template rocoto XML file for the FV3-LAM work- -# flow that need modules not loaded in the env_fn above. +# flow that need modules not loaded in the BUILD_MOD_FN above. # # The full path to a module file for a given task is # diff --git a/ush/setup.py b/ush/setup.py index cd90f7066..261f0e26a 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -368,17 +368,17 @@ def setup(): # #----------------------------------------------------------------------- # - # Set the names of the build and workflow environment files (if not + # Set the names of the build and workflow module files (if not # already specified by the user). These are the files that need to be # sourced before building the component SRW App codes and running various # workflow scripts, respectively. # #----------------------------------------------------------------------- # - global WFLOW_ENV_FN, BUILD_ENV_FN + global WFLOW_MOD_FN, BUILD_MOD_FN machine=lowercase(MACHINE) - WFLOW_ENV_FN=WFLOW_ENV_FN or f"wflow_{machine}.env" - BUILD_ENV_FN=BUILD_ENV_FN or f"build_{machine}_{COMPILER}.env" + WFLOW_MOD_FN=WFLOW_MOD_FN or f"wflow_{machine}" + BUILD_MOD_FN=BUILD_MOD_FN or f"build_{machine}_{COMPILER}" # #----------------------------------------------------------------------- # diff --git a/ush/setup.sh b/ush/setup.sh index 835ccfea4..d9bdffdf1 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -523,7 +523,7 @@ fi # #----------------------------------------------------------------------- # -# Set the names of the build and workflow environment files (if not +# Set the names of the build and workflow module files (if not # already specified by the user). These are the files that need to be # sourced before building the component SRW App codes and running various # workflow scripts, respectively. @@ -531,8 +531,8 @@ fi #----------------------------------------------------------------------- # machine=$(echo_lowercase ${MACHINE}) -WFLOW_ENV_FN=${WFLOW_ENV_FN:-"wflow_${machine}.env"} -BUILD_ENV_FN=${BUILD_ENV_FN:-"build_${machine}_${COMPILER}.env"} +WFLOW_MOD_FN=${WFLOW_MOD_FN:-"wflow_${machine}"} +BUILD_MOD_FN=${BUILD_MOD_FN:-"build_${machine}_${COMPILER}"} # #----------------------------------------------------------------------- # From cf8289e18423f3f1f61179404c92cad95c4827bb Mon Sep 17 00:00:00 2001 From: chan-hoo Date: Mon, 2 May 2022 15:18:55 +0000 Subject: [PATCH 2/2] update we2e script --- tests/WE2E/run_WE2E_tests.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/WE2E/run_WE2E_tests.sh b/tests/WE2E/run_WE2E_tests.sh index bcc3b0a6a..0adf6d737 100755 --- a/tests/WE2E/run_WE2E_tests.sh +++ b/tests/WE2E/run_WE2E_tests.sh @@ -94,7 +94,7 @@ Usage: [stmp=\"...\"] \\ [ptmp=\"...\"] \\ [compiler=\"...\"] \\ - [build_env_fn=\"...\"] + [build_mod_fn=\"...\"] The arguments in brackets are optional. The arguments are defined as follows: @@ -211,9 +211,9 @@ compiler: Type of compiler to use for the workflow. Options are \"intel\" and \"gnu\". Default is \"intel\", -build_env_fn: -Specify the build environment (see ufs-srweather-app/envs) to -use for the workflow. (e.g. build_cheyenne_gnu.env). If a +build_mod_fn: +Specify the build module files (see ufs-srweather-app/modulefiles) to +use for the workflow. (e.g. build_cheyenne_gnu). If a \"gnu\" compiler is specified, it must also be specified with the \"compiler\" option. " @@ -253,7 +253,7 @@ valid_args=( \ "stmp" \ "ptmp" \ "compiler" \ - "build_env_fn" \ + "build_mod_fn" \ ) process_args valid_args "$@" # @@ -685,7 +685,7 @@ Please correct and rerun." MACHINE="${machine^^}" ACCOUNT="${account}" COMPILER=${compiler:-"intel"} - BUILD_ENV_FN=${build_env_fn:-"build_${machine}_${COMPILER}.env"} + BUILD_MOD_FN=${build_mod_fn:-"build_${machine}_${COMPILER}"} EXPT_BASEDIR="${expt_basedir}" EXPT_SUBDIR="${test_name}" USE_CRON_TO_RELAUNCH=${use_cron_to_relaunch:-"TRUE"} @@ -710,7 +710,7 @@ MACHINE=\"${MACHINE}\" ACCOUNT=\"${ACCOUNT}\" COMPILER=\"${COMPILER}\" -BUILD_ENV_FN=\"${BUILD_ENV_FN}\"" +BUILD_MOD_FN=\"${BUILD_MOD_FN}\"" if [ -n "${exec_subdir}" ]; then expt_config_str=${expt_config_str}"