Commit 59a96642 authored by Valentin Pelloin's avatar Valentin Pelloin

exit code of slurm_execute now corresponding to exit code of sbatch

parent 707a8dec
......@@ -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 $?
......@@ -7,6 +7,6 @@ if [ -f "$output" ]; then
rm $output
fi
cat <(echo -e "#!/bin/sh \nset -e") > .slurm_batch_script_job_$i.sh
cat <(echo -e "#!/bin/bash \nset -e") > .slurm_batch_script_job_$i.sh
echo $output
......@@ -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" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment