-
Notifications
You must be signed in to change notification settings - Fork 3
/
resubmit
executable file
·48 lines (39 loc) · 1.27 KB
/
resubmit
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
#!/bin/bash
UI_WORKING_DIR=$1
jobName=${2:-test}
queue=${4:-cmscaf1nd}
IFS=','
for job in $3
do
jmin=`echo $job | cut -d '-' -f 1`
jmax=`echo $job | cut -d '-' -f 2`
job=`seq -s ',' $jmin $jmax`
joblist=`echo $joblist,$job | tr ' ' ',' | sed 's|^,||'`
done
nJobs=`tail -1 $UI_WORKING_DIR/share/filelist | cut -d ' ' -f 1`
# if [ ! -e "${UI_WORKING_DIR}/res/submitted" ];
# then
# echo "[ERROR `basename $0`] job never submitted"
# exit 1
# fi
for j in $joblist
do
if grep -s "$j 0" ${UI_WORKING_DIR}/res/$j.status ; then
echo "[WARNING `basename $0`] job done, if you want to force resubmitssion, please remove the .status file" >> /dev/stderr
else
if grep -s "SUBMITTED" ${UI_WORKING_DIR}/res/$j.status ; then
echo "[WARNING `basename $0`] job done, if you want to force resubmitssion, please remove the .status file" >> /dev/stderr
else
rm ${UI_WORKING_DIR}/res/$j-std*
submit $UI_WORKING_DIR $jobName $queue $j
fi
fi
done
exit 0
for job in
JOBID=`grep "submitted to queue" $UI_WORKING_DIR/bsub.log | sed 's|Job <\([0-9]*\)> is submitted to queue <cmscaf1nd>.|\1|' | head -1`
echo $JOBID > $UI_WORKING_DIR/JOBID
touch $UI_WORKING_DIR/res/submitted
else
echo "[WARNING `basename $0`] Jobs for $UI_WORKING_DIR have been already submitted" >> /dev/stderr
fi