1- # ###############################################
2- # JSC Course bashrc
1+ # The following modifications exist
32#
4- # This file is usually called "env.sh" and is to be loaded as the very first part of a course; it setups environment variables and commands which are relied upon in the course.
3+ # - $JSCCOURSE_PROJECT: Something like "training2024"; used to generate the path
4+ # - $JSCCOURSE_SHORTNAME: Something like "CUDA-Course"; used as destination in $HOME
5+ # - $JSCCOURSE_HUMANNAME: Something like "CUDA Course 2024: Foundations"; used in banner
56#
6- # There are a number of opportunities to steer variables in this script from the outside.
7- # * $JSCCOURSE_DIR_LOCAL_BASE: If this variable is set, it will be used within the target to rsync the material to. In this folder, the course folder will be created. It defaults to $HOME
8- # * $partition: If this variable is set, it will be used to specify the partition to run on. It has a system-specific default
9- # * $_JSCCOURSE_OVERRIDE_LOCALE: If this variable is set (to anything), this env.sh will not set all locale stuff to en_US.UTF-8
7+ # Further, more hidden variables exist, mostly for debugging
8+ #
9+ # - $partition: To override the partition for Slurm
10+ # - $_JSCCOURSE_OVERRIDE_LOCALE: Usually we override the locale; setting this variable prevents it
11+ #
12+ # Expose more functionality if needed.
1013#
11- # Andreas Herten, >2017
12- # ###############################################
13- if [ -z " $_JSCCOURSE_ENV_SOURCED " ]; then
14- project=" training2555"
14+ # - A. Herten, Jun 2024
1515
16- export JSCCOURSE_DIR_GROUP=/p/project1/$project
17- export JSCCOURSE_DIR_LOCAL=${JSCCOURSE_DIR_LOCAL_BASE:- $HOME } /SC25-Multi-GPU-Tutorial
16+
17+ if [ -z " $_JSCCOURSE_ENV_SOURCED " ]; then
18+ project=" training2502"
19+ _JSCCOURSE_PROJECT=${JSCCOURSE_PROJECT:- $project }
20+ _JSCCOURSE_SHORTNAME=${JSCCOURSE_SHORTNAME:- " GPU-Course" }
21+ _JSCCOURSE_HUMANNAME=${JSCCOURSE_HUMANNAME:- " GPU Course" }
22+ __SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
23+
24+ temp_var=" PROJECT_$_JSCCOURSE_PROJECT "
25+ export JSCCOURSE_DIR_GROUP=${! temp_var}
1826
1927 export _JSCCOURSE_ENV_SOURCED=" $( date) "
20- export C_V_D=" 0,1,2,3"
2128
22- jutil env activate -p $project -A $project
29+ jutil env activate -p $JSCCOURSE_PROJECT -A $JSCCOURSE_PROJECT
2330
24- res=" "
2531 currentday=$( date +%d)
2632 if [[ " $currentday " == " 13" ]]; then
2733 res=" --reservation sc25-mgpu"
@@ -42,7 +48,7 @@ if [ -z "$_JSCCOURSE_ENV_SOURCED" ]; then
4248 partition=${partition:- gpus}
4349 export _JSCCOURSE_GPU_ARCH=' 70'
4450 ;;
45- juwelsbooster)
51+ juwels| juwelsbooster)
4652 ngpus=4
4753 export NP=4
4854 partition=${partition:- booster}
@@ -52,7 +58,7 @@ if [ -z "$_JSCCOURSE_ENV_SOURCED" ]; then
5258 jurecadc)
5359 ngpus=4
5460 export NP=4
55- partition=${partition:- dc-gpu}
61+ partition=${partition:- dc-gpu}
5662 JSC_SUBMIT_CMD_SYSTEM_SPECIFIC_OPTIONS=" --disable-dcgm"
5763 export _JSCCOURSE_GPU_ARCH=' 80'
5864 ;;
@@ -69,13 +75,12 @@ if [ -z "$_JSCCOURSE_ENV_SOURCED" ]; then
6975 ;;
7076 esac
7177
72- export JSC_BATCH_CONFIG=" $res --partition ${partition} --gres=gpu:$ngpus $JSC_SUBMIT_CMD_SYSTEM_SPECIFIC_OPTIONS --time 0:10:00"
78+ export JSC_BATCH_CONFIG=" $res --partition ${partition:- booster } --gres=gpu:$ngpus $JSC_SUBMIT_CMD_SYSTEM_SPECIFIC_OPTIONS --time 0:10:00"
7379 export JSC_ALLOC_CMD=" salloc $JSC_BATCH_CONFIG "
74- # export JSC_SUBMIT_CMD="srun $JSC_BATCH_CONFIG --pty"
75- export JSC_SUBMIT_CMD=" ${JSC_ALLOC_CMD} srun --cpu-bind=sockets --pty"
80+ export JSC_SUBMIT_CMD=" ${JSC_ALLOC_CMD} srun --cpu-bind=sockets --unbuffered"
7681
77- export _JSC_MATERIAL_SYNC=" rsync --archive --update --exclude='.*' --exclude='.*/' $JSCCOURSE_DIR_GROUP /common/material/ $JSCCOURSE_DIR_LOCAL "
78- export _JSC_MATERIAL_SYNC_FORCE=" rsync --archive --exclude='.*' --exclude='.*/' $JSCCOURSE_DIR_GROUP /common/material/ $JSCCOURSE_DIR_LOCAL "
82+ export _JSC_MATERIAL_SYNC=" rsync --archive --update --exclude='.*' --exclude='.*/' $JSCCOURSE_DIR_GROUP /common/material/ ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
83+ export _JSC_MATERIAL_SYNC_FORCE=" rsync --archive --exclude='.*' --exclude='.*/' $JSCCOURSE_DIR_GROUP /common/material/ ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
7984
8085
8186 export PS1=" \[\033[0;34m\]Ⓒ\[\033[0m\] $PS1 "
@@ -97,30 +102,32 @@ if [ -z "$_JSCCOURSE_ENV_SOURCED" ]; then
97102fi
98103
99104if [[ $- =~ " i" ]]; then
100- for script in modules.sh; do
101- abs_script=$JSCCOURSE_DIR_GROUP /common/environment/ $script
105+ for script_rel in modules.sh; do
106+ abs_script=$__SCRIPT_DIR / $script_rel
102107 if [ -e $abs_script ]; then
103108 source $abs_script
104109 fi
105110 done
111+ export MPI_HOME=$EBROOTOPENMPI
112+
106113
107114 alias jsc-material-sync=' bash -c "eval $_JSC_MATERIAL_SYNC"'
108115 alias jsc-material-sync-force=' bash -c "eval $_JSC_MATERIAL_SYNC_FORCE"'
109- alias jsc-material-reset-01=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/01-* $JSCCOURSE_DIR_LOCAL "
110- alias jsc-material-reset-02=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/02-* $JSCCOURSE_DIR_LOCAL "
111- alias jsc-material-reset-03=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/03-* $JSCCOURSE_DIR_LOCAL "
112- alias jsc-material-reset-04=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/04-* $JSCCOURSE_DIR_LOCAL "
113- alias jsc-material-reset-05=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/05-* $JSCCOURSE_DIR_LOCAL "
114- alias jsc-material-reset-06=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/06-* $JSCCOURSE_DIR_LOCAL "
115- alias jsc-material-reset-07=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/07-* $JSCCOURSE_DIR_LOCAL "
116- alias jsc-material-reset-08=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/08-* $JSCCOURSE_DIR_LOCAL "
117- alias jsc-material-reset-09=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/09-* $JSCCOURSE_DIR_LOCAL "
118- alias jsc-material-reset-10=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/10-* $JSCCOURSE_DIR_LOCAL "
119- alias jsc-material-reset-11=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/11-* $JSCCOURSE_DIR_LOCAL "
116+ alias jsc-material-reset-01=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/01-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
117+ alias jsc-material-reset-02=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/02-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
118+ alias jsc-material-reset-03=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/03-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
119+ alias jsc-material-reset-04=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/04-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
120+ alias jsc-material-reset-05=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/05-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
121+ alias jsc-material-reset-06=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/06-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
122+ alias jsc-material-reset-07=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/07-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
123+ alias jsc-material-reset-08=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/08-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
124+ alias jsc-material-reset-09=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/09-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
125+ alias jsc-material-reset-10=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/10-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
126+ alias jsc-material-reset-11=" rsync --archive --delete $JSCCOURSE_DIR_GROUP /common/material/11-* ${JSCCOURSE_DIR_USER :- $HOME } / ${_JSCCOURSE_SHORTNAME} / "
120127
121128 echo " "
122129 echo " *******************************************************************************"
123- echo " Welcome to the SC25 Tutorial on Multi-GPU Computing for Exascale! "
130+ echo " Welcome to ${_JSCCOURSE_HUMANNAME} "
124131 # echo " A default call to get a batch system allocation is stored in \$JSC_ALLOC_CMD!"
125132 # echo " Use it with \`eval \$JSC_ALLOC_CMD\`. The value of \$JSC_ALLOC_CMD is:"
126133 # echo -n " "
0 commit comments