-
Notifications
You must be signed in to change notification settings - Fork 1
/
desi_environment.sh
33 lines (33 loc) · 1.07 KB
/
desi_environment.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# This code is meant to be sourced, not executed.
# It currently only supports NERSC hosts.
#
if [[ $(basename ${SHELL}) == "bash" || $(basename ${SHELL}) == "sh" || $(basename ${SHELL}) == "zsh" ]]; then
if [[ $# > 0 ]]; then
_desi_release="/$1"
else
_desi_release=''
fi
_desi_startup=/global/common/software/desi/${NERSC_HOST}/desiconda/startup/modulefiles
if [[ -n "${DESI_ROOT}" ]]; then
# Do nothing, successfully.
:
elif [[ -n "${NERSC_HOST}" ]]; then
export DESI_ROOT=/global/cfs/cdirs/desi
else
echo "Could not determine a valid value of DESI_ROOT!"
return
fi
if [[ "${NERSC_HOST}" == "perlmutter" || \
"${NERSC_HOST}" == "cori" || \
"${NERSC_HOST}" == "datatran" ]]; then
module use ${_desi_startup}
module load desimodules${_desi_release}
else
echo "DESI+Anaconda environment is not supported on ${NERSC_HOST}!"
fi
unset _desi_startup
unset _desi_release
else
echo "You are not sourcing the correct file for your shell!"
fi