forked from FairRootGroup/FairRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslurm-submit.sh
executable file
·57 lines (51 loc) · 1.18 KB
/
slurm-submit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /bin/bash
if [ $# != 2 ]
then
echo "*** Please call like: $0 LABEL JOBSH"
exit 1
fi
label="$1"
jobsh="$2"
if [ -z "$ALFACI_SLURM_CPUS" ]
then
# ALFACI_SLURM_CPUS=20
:
fi
if [ -z "$ALFACI_SLURM_EXTRA_OPTS" ]
then
ALFACI_SLURM_EXTRA_OPTS="--exclusive --cpu-bind=no"
fi
if [ -z "$ALFACI_SLURM_TIMEOUT" ]
then
ALFACI_SLURM_TIMEOUT=30
fi
if [ -z "$ALFACI_SLURM_QUEUE" ]
then
ALFACI_SLURM_QUEUE=main
fi
echo "*** Slurm request options :"
echo "*** Working directory ..: $PWD"
echo "*** Queue ..............: $ALFACI_SLURM_QUEUE"
if [ -n "$ALFACI_SLURM_CPUS" ]
then
echo "*** CPUs ...............: $ALFACI_SLURM_CPUS"
fi
echo "*** Wall Time ..........: $ALFACI_SLURM_TIMEOUT min"
echo "*** Job Name ...........: ${label}"
echo "*** Extra Options ......: ${ALFACI_SLURM_EXTRA_OPTS}"
srun_cmdline_opts="-p $ALFACI_SLURM_QUEUE -n 1 -N 1 -t $ALFACI_SLURM_TIMEOUT"
if [ -n "$ALFACI_SLURM_CPUS" ]
then
srun_cmdline_opts="$srun_cmdline_opts -c $ALFACI_SLURM_CPUS"
fi
echo "*** Submitting job at ....: $(date -R)"
(
set -x
srun $srun_cmdline_opts \
--job-name="${label}" \
${ALFACI_SLURM_EXTRA_OPTS} \
bash "${jobsh}"
)
retval=$?
echo "*** Exit Code ............: $retval"
exit "$retval"