Git would be an easy way to manage module files on KAUST clusters.
- Clone this repo to your home directory either on your laptop or lthdevapps box
mkdir -p ~/git && cd ~/git && git clone https://gitlab.kaust.edu.sa/kaust-rc/modules-intel.git
- Create or modify any required file then do the following
- Lets say that you added
netcdftolibs - Don't forget to do a
git pullto get latest updates
- Lets say that you added
The following testing steps works if you cloned the repo to your cluster home
- Modify
KAUST_MODULES_ROOT&MODULEPATHenvironment variables to match your repoKAUST_MODULES_ROOT=~/git/modules-intelMODULEPATH=$KAUST_MODULES_ROOT/applications:$KAUST_MODULES_ROOT/compilers:$KAUST_MODULES_ROOT/libs:$KAUST_MODULES_ROOT/workstations
- If the tests passed successfully, commit and push your changes
git commit -am "Adding netcdf libraries"git push
tmode(){
if [[ ! $TEST_MODE ]];then
#backup old variables
OLD_KAUST_MODULES_ROOT=$KAUST_MODULES_ROOT;
OLD_MODULEPATH=$MODULEPATH;
OLD_PS1=$PS1;
#setting new variables (change KAUST_MODULES_ROOT according to your cloned modules path and the used cluster)
HOSTNAME=$(hostname -s)
case "$HOSTNAME" in
'lthdevapps' )
KAUST_MODULES_ROOT=~/git/modules-intel;
;;
*)
echo "Couldn't determine development node!"
exit 1
esac
MODULEPATH=$KAUST_MODULES_ROOT/applications:$KAUST_MODULES_ROOT/compilers:$KAUST_MODULES_ROOT/libs:$KAUST_MODULES_ROOT/sets;
PS1="$PS1\[\033[38;5;9m\]\[test mode\]\[$(tput sgr0)\] > ";
TEST_MODE=1;
else
echo "You are using the test mode!"
fi
}
pmode(){
#
if [[ $TEST_MODE ]]; then
KAUST_MODULES_ROOT=$OLD_KAUST_MODULES_ROOT;
MODULEPATH=$OLD_MODULEPATH;
PS1=$OLD_PS1;
#removing old variables
unset OLD_KAUST_MODULES_ROOT OLD_MODULEPATH OLD_PS1 TEST_MODE;
else
echo "You are using the production mode!"
fi
}