Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Pelloin
slurm-tools
Commits
59a96642
Commit
59a96642
authored
Mar 26, 2020
by
Valentin Pelloin
Browse files
exit code of slurm_execute now corresponding to exit code of sbatch
parent
707a8dec
Changes
3
Hide whitespace changes
Inline
Side-by-side
bin/slurm_execute
View file @
59a96642
...
...
@@ -57,6 +57,7 @@ if [ "$#" -gt 1 ]; then
elif
[
"$#"
==
1
]
;
then
stdout
=
.stdout
$1
params+
=(
--output
$stdout
)
params+
=(
--error
$stdout
)
params+
=(
-K1
)
if
[
-f
$stdout
]
;
then
...
...
@@ -76,9 +77,8 @@ elif [ "$#" == 1 ]; then
sed
-i
"3 i
$text
"
$1
chmod
+x
$1
jobid
=
$(
srun
"
${
params
[@]
}
"
$1
&
)
&
jobid
=
$(
srun
"
${
params
[@]
}
"
$1
)
&
tail
--pid
$(
jobs
-p
)
-f
$stdout
wait
else
echo
"Not enough jobs given"
exit
1
...
...
@@ -108,5 +108,8 @@ for script in $@; do
done
if
$cancel
;
then
exit
0
exit
1
fi
wait
$!
exit
$?
bin/slurm_prepare
View file @
59a96642
...
...
@@ -7,6 +7,6 @@ if [ -f "$output" ]; then
rm
$output
fi
cat
<
(
echo
-e
"#!/bin/sh
\n
set -e"
)
>
.slurm_batch_script_job_
$i
.sh
cat
<
(
echo
-e
"#!/bin/
ba
sh
\n
set -e"
)
>
.slurm_batch_script_job_
$i
.sh
echo
$output
example/test.sh
View file @
59a96642
...
...
@@ -4,10 +4,15 @@ id=$(slurm_prepare)
slurm_add_command
$id
\
echo
"Starting a big script..."
slurm_add_command
$id
\
ls
-1
/
\|
grep
usr
slurm_add_command
$id
\
sleep
10
slurm_add_command
$id
\
echo
"It is done!"
slurm_add_command
$id
exit
0
slurm_execute
\
--mem
"200M"
\
...
...
Write
Preview
Supports
Markdown
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