Skip to content
Snippets Groups Projects
Commit ce495974 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer
Browse files

Allow multinode jobs

parent a124b219
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,11 @@ SVNC_GEOMETRY="1920x1200"
# Session run time in minutes
SVNC_RUNTIME=240
# Number of GPU nodes reserved. Default is the special value "half"
# which allocates 24 cores of a node. To allocate one or more nodes,
# set to the integer number of nodes.
SVNC_NODES="half"
# Quality of service
SVNC_QOS="normal"
......@@ -138,8 +143,9 @@ clean_up () {
usage () {
printf "Usage: %s [OPTIONS]\n" $(basename $0) >&2
printf -- "-u username\n-A acctcode\n-g geometry\n-q qos\n-t time\n" >&2
printf -- "-v path_to_vncviewer\n-x vncviewer_options\n" >&2
printf -- "-u username\n-A acctcode\n-g geometry\n-n nodes\n" >&2
printf -- "-q qos\n-t time\n-v path_to_vncviewer\n" >&2
printf -- "-x vncviewer_options\n" >&2
}
ssh_frontend () {
......@@ -152,12 +158,14 @@ ssh_frontend () {
parse_options () {
local option
while getopts 'A:g:q:t:u:v:x:' option; do
while getopts 'A:g:n:q:t:u:v:x:' option; do
case ${option} in
A) SVNC_ACCTCODE="$OPTARG"
;;
g) SVNC_GEOMETRY="$OPTARG"
;;
n) SVNC_NODES="$OPTARG"
;;
q) SVNC_QOS="$OPTARG"
;;
t) SVNC_RUNTIME="$OPTARG"
......@@ -200,10 +208,15 @@ prepare_vncserver () {
}
submit_vnc_job () {
if [[ ${SVNC_NODES} = "half" ]]; then
local sbatch_resources="#SBATCH --ntasks=24"
else
local sbatch_resources="#SBATCH --nodes=${SVNC_NODES}"
fi
ssh_frontend "cd .startvnc && sbatch" <<EOF
#!/bin/bash -l
#SBATCH --partition=gpu
#SBATCH --ntasks=24
${sbatch_resources}
#SBATCH --qos=${SVNC_QOS}
#SBATCH --time=${SVNC_RUNTIME}
#SBATCH --account=${SVNC_ACCTCODE}
......@@ -211,6 +224,8 @@ submit_vnc_job () {
#SBATCH --parsable
#SBATCH --dkrzepilog=0
cd \${HOME}
scontrol show hostname \${SLURM_JOB_NODELIST} > \
.startvnc/nodelist_\${SLURM_JOB_ID}.txt
/opt/TurboVNC/bin/vncserver -fg -geometry "${SVNC_GEOMETRY}" -localhost
EOF
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment