-
Notifications
You must be signed in to change notification settings - Fork 1
/
q-result
executable file
·62 lines (52 loc) · 955 Bytes
/
q-result
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
58
59
60
61
62
#!/bin/bash
d=$(pwd)
bname=`basename $d`
DIR=$d/TMPQCEIMS
echo $DIR
if [ ! -d "$DIR" ]; then
echo "run mpspred first!"
exit
fi
cd $DIR
count=$(ls -d TMP.* | wc -l)
queued=0
running=0
done=0
failed=0
lost=0
rm -f qceims.res
for vz in TMP.*; do
cd $vz
VZ_NUM=`echo $vz | awk -F . '{print $2}'`
VZ_DIR=`pwd`
if [ -f ready ]; then
if [ "$(cat ready)" = "0" ]; then
done=$(($done + 1))
cat qceims.res >>../qceims.res
else
echo $VZ_NUM: failed with $(cat ready) >&2
failed=$((failed + 1))
fi
else
jobid=$(cat jobid)
if qout="$(qstat $jobid)"; then
stat=$(tail -1 <<<"$qout")
set -- $stat
case $5 in
Q) queued=$(($queued + 1)) ;;
R) running=$(($running + 1)) ;;
esac
else
lost=$(($lost + 1))
fi
fi
cd ..
done
cat - <<EOF
TOTAL: $count
queued: $queued
running: $running
done: $done
failed: $failed
lost: $lost
EOF