Skip to content

Commit

Permalink
#3571: Rename KGO dir environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-gill committed Jun 17, 2024
1 parent 7d1c535 commit 6dc240d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[command]
default=rtw-env python ${COMPARE_SCRIPT} ${RTW_KGOS} ${COMPARISON_OUTPUT_DIR}
default=rtw-env python ${COMPARE_SCRIPT} ${KGO_DIR} ${COMPARISON_OUTPUT_DIR}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
KGO_ROOT_PATH = {{ KGO_ROOT_PATH }}
COMPARE_SCRIPT=${ESMVALTOOL_DIR}/esmvaltool/utils/testing/regression/compare.py
COMPARISON_OUTPUT_DIR=${OUTPUT_DIR}/${RECIPE_NAME}*
RTW_KGOS=${KGO_ROOT_PATH}/${RECIPE_NAME}*
KGO_DIR=${KGO_ROOT_PATH}/${RECIPE_NAME}*


[[compare<medium>]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,30 @@
#
# OPTIONS
# COMMAND The command to execute with options

# ----------------------------------
# I AM CHANGED AND GIT CAN'T SEE ME!
# ----------------------------------

set +eu
module unload R
conda activate /home/h02/cbillows/.conda/envs/esmvaltool-v2.10-temp
set -eu

module_count(){
module list -t 2>&1 | wc -l
}
# module_count(){
# module list -t 2>&1 | wc -l
# }

safe_load(){
PRE_LOAD_COUNT=$(module_count)
# safe_load(){
# PRE_LOAD_COUNT=$(module_count)

module load "${1}"
# Check module count to determine whether module load was successful.
if (( PRE_LOAD_COUNT == $(module_count) )); then
echo "[ERROR] Failed to load: ${1}"
exit 1
fi
}
# module load "${1}"
# # Check module count to determine whether module load was successful.
# if (( PRE_LOAD_COUNT == $(module_count) )); then
# echo "[ERROR] Failed to load: ${1}"
# exit 1
# fi
# }

# Must be run before importing numpy, see
# https://www-avd/sci/dask_best_practice/numpy-threads.html.
Expand All @@ -38,7 +46,7 @@ export NUMEXPR_NUM_THREADS=1
# Ensure '~/.local' isn't added to 'sys.path'.
export PYTHONNOUSERSITE=True

safe_load "${ENV_NAME}"
# safe_load "${ENV_NAME}"

# If PYTHONPATH_PREPEND has been set, prepend it to PYTHONPATH to extend the
# Python environment.
Expand All @@ -47,9 +55,9 @@ if [[ ! -z ${PYTHONPATH_PREPEND:-} ]]; then
export PYTHONPATH=${PYTHONPATH_PREPEND}:${PYTHONPATH:-}
fi

if [[ -z ${QUIET_MODE:-} ]]; then
echo "[OK] Modules loaded."
fi
# if [[ -z ${QUIET_MODE:-} ]]; then
# echo "[OK] Modules loaded."
# fi

command="/usr/bin/time -v -o ${CYLC_TASK_LOG_ROOT}.time $@"
exec ${command}

0 comments on commit 6dc240d

Please sign in to comment.