Files
MX_Pmodule/Programming/anaconda/files/admintools/kernelwrapper.sh
bliven_s 308fd1c890 CrYOLO/1.6.1 modules
There are _cpu and _gpu flags available, which are selected based on
fancy modulefile code (Thanks Achim)
2020-07-15 16:57:12 +02:00

28 lines
594 B
Bash
Executable File

#!/bin/bash
dbgecho() {
DBGLOG=/tmp/kernelwrapper-${USER}.log
if [[ $DEBUG_JUPYTER_WRAPPER == 1 ]]; then
echo "$1" >> $DBGLOG
fi
}
DATE=$(date +%Y-%m-%dT%H:%M)
dbgecho "$DATE: $@"
# ensure that module commands are available
dbgecho "sourcing profile.bash"
source /opt/psi/config/profile.bash
dbgecho "sourcing conda.sh"
source /opt/psi/Programming/anaconda/2019.07/conda/etc/profile.d/conda.sh &>> $DBGLOG
dbgecho "Running activate"
conda activate $1
# undefine module command since it causes error in the notebook when using
# shell escapes
unset -f module
shift
exec "$@"