Skip to content

Commit 1ad8c98

Browse files
committed
Move to new modular environment
1 parent 3cb03b1 commit 1ad8c98

File tree

10 files changed

+80
-52
lines changed

10 files changed

+80
-52
lines changed

.etc/.set-facl-permissions.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
5+
course_project=${1:-$PROJECT_training2555}
6+
7+
for user in haghighimood1 kraus1 hrywniak1 oden1 garciadegonzalo1 badwaik1 john2 appelhans1; do
8+
setfacl -m u:$user:rwx -R $course_project/common/
9+
setfacl -m u:$user:rwx -R $course_project/env.sh
10+
done
11+
12+
set +x

.etc/common-env/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GPU Course Environment
2+
3+
This repository contains the usual scripts we need to run a JSC GPU course. Usually, it is included as a submodule in a specific course's environment; here, we have a static copy.

.etc/common-env/deploy.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if [[ ! $PWD == *"common-env"* ]]; then
2+
rsync --archive --exclude="deploy.sh" --exclude="raw/" --exclude="sc2*-titleslides/" --verbose . jureca.fz-juelich.de:/p/project/training2555/common/environment/
3+
else
4+
echo "You seem to be in ./common-env/; please go up one dir."
5+
fi

.etc/jsccourse-bashrc.sh renamed to .etc/common-env/jsccourse-bashrc.sh

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
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
97102
fi
98103

99104
if [[ $- =~ "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 " "

.etc/modules.sh renamed to .etc/common-env/modules.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export MPI_HOME=$EBROOTOPENMPI
77
module load NCCL/default-CUDA-12 #2.22.3-1
88
module load NVSHMEM/3.1.7-CUDA-12
99
module load Nsight-Systems/2025.3.1
10-
module load MPI-settings/CUDA
10+
module load MPI-settings/CUDA
11+
module use $JSCCOURSE_DIR_GROUP/common/modulefiles

.etc/deploy-material.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
rsync --archive --exclude="*minified.pdf" --exclude="tut*" --exclude=".*" --exclude="*-sc*.pdf" --verbose ../ judac:/p/project1/training2555/common/material/
1+
if [[ ! $PWD == *"env"* ]]; then
2+
rsync --archive --exclude="*minified.pdf" --exclude="tut*" --exclude=".*" --exclude="*-sc*.pdf" --verbose .. jureca.fz-juelich.de:/p/project/training2555/common/material/
3+
else
4+
echo "You seem to be in ./env/; please go up one dir."
5+
fi

.etc/deploy.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

.etc/env.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export JSCCOURSE_PROJECT=training2555
2+
export JSCCOURSE_SHORTNAME=SC25-Multi-GPU-Tutorial
3+
export JSCCOURSE_HUMANNAME="SC25 Tutorial on Multi-GPU Computing for Exascale"
4+
5+
# Note: Reservations are not properly supported
6+
7+
source /p/project1/$JSCCOURSE_PROJECT/common/environment/common-env/jsccourse-bashrc.sh

.etc/printout.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252

5353
\vspace*{1\baselineskip}
5454
\begin{enumerate}
55-
\item Create \highlight{\emph{JuDoor}} account, \highlight{join} \texttt{training2526} project: \href{https://go.fzj.de/mg-jd}{\texttt{go.fzj.de/mg-jd}}
55+
\item Create \highlight{\emph{JuDoor}} account, \highlight{join} \texttt{training2555} project: \href{https://go.fzj.de/mg-jd}{\texttt{go.fzj.de/mg-jd}}
5656
\item Fill \highlight{usage agreement}; wait at least 15 min for synchronization
5757
\item Login to \highlight{Jupyter}: \href{https://go.fzj.de/mg-jup}{\texttt{https://go.fzj.de/mg-jup}} (JuDoor credentials like \texttt{usr1})
5858
\item Create new Jupyter \highlight{instance} on JUPITER using \texttt{LoginNode} with training project (pre-selected)
5959
\item Start Jupyter Terminal, \highlight{source} course environment\\
60-
\verb|source $PROJECT_training2526/env.sh|
60+
\verb|source $PROJECT_training2555/env.sh|
6161
\item \highlight{Sync} course material: \verb|jsc-material-sync|
6262
\end{enumerate}
6363
\end{document}

0 commit comments

Comments
 (0)