Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sofiane Bendoukha
ssh_scripts
Commits
8028d68b
Commit
8028d68b
authored
May 11, 2021
by
Sofiane Bendoukha
Browse files
Add gpu support (--nv).
parent
2a1a1653
Changes
1
Hide whitespace changes
Inline
Side-by-side
start-jupyter
View file @
8028d68b
...
...
@@ -101,6 +101,11 @@ SJ_FRONTEND_HOST="mistralpp.dkrz.de"
# image name.
SJ_IMAGE
=
""
# Slurm Options
# additional slurm options that users
# can pass to the sbatch script
SJ_SLURM_OPTIONS
=
""
function
clean_up
()
{
trap
- ERR EXIT
set
+e
...
...
@@ -140,6 +145,7 @@ Available values for OPTION include:
-d check for presence of jupyter
-f system mistral, vader
-i file source file prior to running jupyter
-o options slurm options
-n ntasks request ntasks tasks for job
-p partition run job on partition
-s image singularity image
...
...
@@ -152,7 +158,7 @@ EOF
function
parse_options
()
{
local
option
while
getopts
'A:c:di:f:n:p:t:u:s:'
option
;
do
while
getopts
'A:c:di:
o:
f:n:p:t:u:s:'
option
;
do
case
${
option
}
in
A
)
SJ_ACCTCODE
=
"
$OPTARG
"
;;
...
...
@@ -164,6 +170,8 @@ function parse_options () {
;;
i
)
SJ_INCFILE
=
"
$OPTARG
"
;;
o
)
SJ_SLURM_OPTIONS
=
"
$OPTARG
"
;;
n
)
SJ_NTASKS
=
"
$OPTARG
"
;;
p
)
SJ_PARTITION
=
"
$OPTARG
"
...
...
@@ -189,6 +197,7 @@ function parse_options () {
readonly
SJ_USERNAME
readonly
SJ_IMAGE
readonly
SJ_FRONTEND_HOST
readonly
SJ_SLURM_OPTIONS
}
function
ssh_frontend
()
{
...
...
@@ -233,7 +242,7 @@ function assemble_commandline () {
commandline
=
"nohup
${
commandline
}
> /dev/null & echo
\$
!"
fi
if
[[
-n
${
SJ_IMAGE
}
]]
;
then
commandline
=
"singularity exec
${
SJ_IMAGE
}
${
commandline
}
"
commandline
=
"singularity exec
--nv
${
SJ_IMAGE
}
${
commandline
}
"
fi
commandline
=
"
$(
source_incfile
"
${
commandline
}
"
)
"
echo
"
${
commandline
}
"
...
...
@@ -252,6 +261,7 @@ function submit_jupyter_job () {
#SBATCH --account=
${
SJ_ACCTCODE
}
#SBATCH --output=/dev/null
#SBATCH --parsable
#SBATCH
${
SJ_SLURM_OPTIONS
}
##SBATCH --dkrzepilog=0
cd
\$
{HOME}
echo "NODE:
\$
{SLURM_JOB_NODELIST}" >
${
logfile
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment