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

Replace env with modulefiles in scripts #752

Merged
merged 2 commits into from
May 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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=""
Expand Down
12 changes: 6 additions & 6 deletions ush/config_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: ""
Expand Down
8 changes: 4 additions & 4 deletions ush/launch_FV3LAM_wflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""
#
#-----------------------------------------------------------------------
#
Expand Down
15 changes: 8 additions & 7 deletions ush/load_modules_run_task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}\""
#
#-----------------------------------------------------------------------
#
Expand All @@ -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
#
Expand Down
8 changes: 4 additions & 4 deletions ush/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
#
#-----------------------------------------------------------------------
#
Expand Down
6 changes: 3 additions & 3 deletions ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -523,16 +523,16 @@ 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.
#
#-----------------------------------------------------------------------
#
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}"}
#
#-----------------------------------------------------------------------
#
Expand Down