-
Notifications
You must be signed in to change notification settings - Fork 87
Add support for Rocoto with generic LINUX platform #617
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
Changes from 7 commits
fba5bec
2897caf
0c7ddf6
a3c7cd0
15cfe9a
429eb20
5532ef9
3fb49fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,6 +131,7 @@ case "$MACHINE" in | |
| ;; | ||
|
|
||
| "LINUX") | ||
| ulimit -s unlimited | ||
| APRUN=$RUN_CMD_UTILS | ||
| ;; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,6 +131,7 @@ case "$MACHINE" in | |
| ;; | ||
|
|
||
| "LINUX") | ||
| ulimit -s unlimited | ||
| APRUN=$RUN_CMD_UTILS | ||
| ;; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,8 @@ case "$MACHINE" in | |
|
|
||
| "LINUX") | ||
| APRUN=time | ||
| ulimit -s unlimited | ||
| ulimit -a | ||
| ;; | ||
|
|
||
| *) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,6 +159,8 @@ case "$MACHINE" in | |
| ;; | ||
|
|
||
| "LINUX") | ||
| ulimit -s unlimited | ||
| ulimit -a | ||
| APRUN=$RUN_CMD_FCST | ||
| ;; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,30 +71,6 @@ fi | |
| # ..." and "module load ..." calls later below that are used to load the | ||
| # appropriate module file for the specified task. | ||
| # | ||
| # Note that the build of the FV3 forecast model code generates the shell | ||
| # script at | ||
| # | ||
| # ${UFS_WTHR_MDL_DIR}/NEMS/src/conf/module-setup.sh | ||
| # | ||
| # that can be used to initialize the Lmod (Lua-based module) system/ | ||
| # software for handling modules. This script: | ||
| # | ||
| # 1) Detects the shell in which it is being invoked (i.e. the shell of | ||
| # the "parent" script in which it is being sourced). | ||
| # 2) Detects the machine it is running on and and calls the appropriate | ||
| # (shell- and machine-dependent) initalization script to initialize | ||
| # Lmod. | ||
| # 3) Purges all modules. | ||
| # 4) Uses the "module use ..." command to prepend or append paths to | ||
| # Lmod's search path (MODULEPATH). | ||
| # | ||
| # We could use this module-setup.sh script to initialize Lmod, but since | ||
| # it is only found in the forecast model's directory tree, here we pre- | ||
| # fer to perform our own initialization. Ideally, there should be one | ||
| # module-setup.sh script that is used by all external repos/codes, but | ||
| # such a script does not exist. If/when it does, we will consider | ||
| # switching to it instead of using the case-statement below. | ||
| # | ||
|
gsketefian marked this conversation as resolved.
|
||
| #----------------------------------------------------------------------- | ||
| # | ||
| print_info_msg "$VERBOSE" " | ||
|
|
@@ -128,10 +104,14 @@ case "$MACHINE" in | |
| ;; | ||
| # | ||
| *) | ||
| print_err_msg_exit "\ | ||
| The script to source to initialize lmod (module loads) has not yet been | ||
| specified for the current machine (MACHINE): | ||
| MACHINE = \"$MACHINE\"" | ||
| if [[ -n ${LMOD_PATH:-""} && -f ${LMOD_PATH:-""} ]] ; then | ||
| . ${LMOD_PATH} | ||
| else | ||
| print_err_msg_exit "\ | ||
| The script to source to initialize lmod (module loads) has not yet been | ||
| specified for the current machine (MACHINE): | ||
| MACHINE = \"$MACHINE\"" | ||
| fi | ||
| ;; | ||
| # | ||
| esac | ||
|
|
@@ -147,13 +127,15 @@ jjob_fp="$2" | |
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| # Sourcing ufs-srweather-app README file (in directory specified by mod- | ||
| # ules_dir) for the specified task | ||
| # Sourcing ufs-srweather-app build env file | ||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
|
|
||
| module purge | ||
|
|
||
| machine=$(echo_lowercase $MACHINE) | ||
| env_fn="build_${machine}_${COMPILER}.env" | ||
| env_fn=${BUILD_ENV_FN:-"build_${machine}_${COMPILER}.env"} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry again for the late input. Since BUILD_ENV_FN now appears in config_defaults.sh, it will also appear in var_defns.sh. If it is not explicitly specified by the user in config.sh, it will be set to its default value (a null string) in var_defns.sh because currently it does not get reset to "build_${machine}_${COMPILER}.env" anywhere. That should happen in setup.sh, i.e. include this in setup.sh: BUILD_ENV_FN=${BUILD_ENV_FN:-"build_${machine}_${COMPILER}.env"} This should be placed somewhere before the line cp_vrfy in setup.sh. This will cause var_defns.sh to contain the correct name of the environment file. It will also make things easier in this file since now we don't need the env_fn variable; we can just use BUILD_ENV_FN (which will be available since var_defns.sh is sourced at the top of this file). |
||
| env_fp="${SR_WX_APP_TOP_DIR}/env/${env_fn}" | ||
| source "${env_fp}" || print_err_msg_exit "\ | ||
| Sourcing platform- and compiler-specific environment file (env_fp) for the | ||
|
|
@@ -172,72 +154,52 @@ workflow task specified by task_name failed: | |
| # sets environment variables (including prepending/appending to paths) | ||
| # and loads modules. | ||
| # | ||
| # The regional_workflow repository contains module files for all the | ||
| # The regional_workflow repository contains module files for the | ||
| # workflow tasks in the template rocoto XML file for the FV3-LAM work- | ||
| # flow. The full path to a module file for a given task is | ||
| # flow that need modules not loaded in the env_fn above. | ||
| # | ||
| # The full path to a module file for a given task is | ||
| # | ||
| # $HOMErrfs/modulefiles/$machine/${task_name} | ||
| # $HOMErrfs/modulefiles/$machine/${task_name}.local | ||
| # | ||
| # where HOMErrfs is the base directory of the workflow, machine is the | ||
| # name of the machine that we're running on (in lowercase), and task_- | ||
| # name is the name of the current task (an input to this script). The | ||
| # collection of modulefiles is staged by the generate_workflow.sh | ||
| # script. Please see that script for information on their creation. | ||
| # name is the name of the current task (an input to this script). | ||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| modules_dir="$HOMErrfs/modulefiles/tasks/$machine" | ||
| modulefile_name="${task_name}" | ||
| default_modules_dir="$HOMErrfs/modulefiles" | ||
| default_modulefile_name="${machine}.default" | ||
| use_default_modulefile=0 | ||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| # Load the module file for the specified task on the current machine. | ||
| # | ||
| #----------------------------------------------------------------------- | ||
| # | ||
| print_info_msg "$VERBOSE" " | ||
|
|
||
| print_info_msg "$VERBOSE" " | ||
| Loading modules for task \"${task_name}\" ..." | ||
|
|
||
| module use "${modules_dir}" || print_err_msg_exit "\ | ||
| module use "${modules_dir}" || print_err_msg_exit "\ | ||
| Call to \"module use\" command failed." | ||
|
|
||
| # | ||
| # If NOT using the default modulefile... | ||
| # | ||
| # if [ ${use_default_modulefile} -eq 0 ]; then | ||
| # | ||
| # module use -a "${modules_dir}" || print_err_msg_exit "\ | ||
| #Call to \"module use\" command failed." | ||
| # | ||
| # | ||
| # Load the .local module file if available for the given task | ||
| # | ||
| modulefile_local="${task_name}.local" | ||
| if [ -f ${modules_dir}/${modulefile_local} ]; then | ||
| module load "${modulefile_local}" || print_err_msg_exit "\ | ||
| Loading .local module file (in directory specified by mod- | ||
| ules_dir) for the specified task (task_name) failed: | ||
| task_name = \"${task_name}\" | ||
| modulefile_local = \"${modulefile_local}\" | ||
| modules_dir = \"${modules_dir}\"" | ||
| fi | ||
|
|
||
| # else # using default modulefile | ||
| # | ||
| # module load "${default_modulefile_name}" || print_err_msg_exit "\ | ||
| #Loading of default module file failed: | ||
| # task_name = \"${task_name}\" | ||
| # default_modulefile_name = \"${default_modulefile_name}\" | ||
| # default_modules_dir = \"${default_modules_dir}\"" | ||
|
gsketefian marked this conversation as resolved.
|
||
| # Load the .local module file if available for the given task | ||
| # | ||
| # fi | ||
| modulefile_local="${task_name}.local" | ||
| if [ -f ${modules_dir}/${modulefile_local} ]; then | ||
| module load "${modulefile_local}" || print_err_msg_exit "\ | ||
| Loading .local module file (in directory specified by mod- | ||
| ules_dir) for the specified task (task_name) failed: | ||
| task_name = \"${task_name}\" | ||
| modulefile_local = \"${modulefile_local}\" | ||
| modules_dir = \"${modules_dir}\"" | ||
| fi | ||
|
|
||
| module list | ||
| module list | ||
|
|
||
| #fi #End if statement for tasks that load no modules | ||
|
|
||
| # Modules that use conda and need an environment activated will set the | ||
| # SRW_ENV variable to the name of the environment to be activated. That | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A user will be defining this in their own wflow env file, anyway, so have the supported platforms do the same for consistency. I do not have enough familiarity with the WCOSS machines to make changes there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good.
But the same comment I have below for BUILD_ENV_FN in load_modules_run_task.sh goes here for WFLOW_ENV_FN, i.e. WFLOW_ENV_FN should be (re)set as necessary in setup.sh, i.e. in setup.sh, include this:
WFLOW_EN_FN=${WFLOW_ENV_FN:-"wflow_${machine}.env"}so that it shows the correct value in var_defns.sh. Then it can be used here instead of needing the new variable env_fn (since var_defns.sh is sourced at the top of launch_FV3LAM_wflow.sh).