-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcheck
executable file
·35 lines (31 loc) · 1.13 KB
/
check
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
#!/bin/bash
UI_WORKING_DIR=$1
nJobs=`cat ${UI_WORKING_DIR}/share/filelist | tail -1 | cut -d ' ' -f 1`
jobid=`tail -1 $UI_WORKING_DIR/JOBID`
echo "------------------------------JOB STATUS"
echo $UI_WORKING_DIR
if ls $UI_WORKING_DIR/res/*.status &> /dev/null ;then
cat $UI_WORKING_DIR/res/*.status | sort -n | awk '(NF==2){status=$2; joblist[status]=sprintf("%s %d", joblist[status], $1)}; END{for(status in joblist){print status, "\t", joblist[status]}}' | awk -f awk/compact.awk | sed 's|,$||' | sort -r | column -t
DONE=`cat $UI_WORKING_DIR/res/*.status | sort -n | awk '(NF==2){status=$2; joblist[status]=sprintf("%s %d", joblist[status], $1)}; END{for(status in joblist){print status, "\t", joblist[status]}}' | awk -f awk/compact.awk | sed 's|,$||' | grep -c -F "[0] 1-${nJobs}"`
if [ "$DONE" == "1" ];
then
echo "JOBS FINISHED"
touch ${UI_WORKING_DIR}/res/finished
#else
# bjobs -A $jobid
fi
else
echo "Jobs not submitted"
echo "submit $UI_WORKING_DIR"
fi
exit 0
for jobid in `seq 1 $nJobs`
do
file=$UI_WORKING_DIR/res/$jobid.status
if [ -e $file ];then
source $file
echo $jobid $EXITSTATUS
else
echo $jobid 55517
fi
done