-
Notifications
You must be signed in to change notification settings - Fork 0
/
progress
120 lines (102 loc) · 3.73 KB
/
progress
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/bash
PROJDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
TEMP=.progresstemp
NETID=$(cat $PROJDIR/.netidtemp)
DOMAIN=utdallas.edu
#command line arguments
CONFIGPATH=$PROJDIR/config
CONFIG=$CONFIGPATH/$(cat $PROJDIR/.configtemp)
PROJDIRSCRIPT='$(echo $AOSMEROOT)'
REMOTEOUT=$PROJDIRSCRIPT/out
CSVFILE=$1
printed=0
done=0
total=0
if [ -n "$2" ]; then
COLS=$2
else
COLS=$(stty size | cut -f2 -d" ")
fi
cat $CONFIG | sed -e "s/#.*//" | sed -e "/^\s*$/d" |
(
read i
nodes=$(echo $i | cut -f1 -d" ")
ird=$(echo $i | cut -f2 -d" ")
cset=$(echo $i | cut -f3 -d" ")
mesgs=$(echo $i | cut -f4 -d" ")
total=$(($nodes * $mesgs))
touch $TEMP
echo $done > $TEMP
while [ $(cat $TEMP) -lt $total ]; do
(
sleep 3
n=0
EXC=""
while [ $n -lt $nodes ]; do
EXC+="cat $REMOTEOUT/Kern$n.out 2>/dev/null; echo;"
n=$(($n + 1))
done
done=$( ( ssh $NETID@dc01.$DOMAIN "$EXC" | grep Granting | wc | sed 's/^ *//' | cut -f1 -d' ' ) )
donecolsprod=$(($done * $COLS))
bars=$(($donecolsprod / $total))
toprint=$(($bars - $printed))
printf "\r"
eval "printf '%0.s=' {1..$toprint}"
echo $done > $TEMP
)
done
rm $TEMP
running=1
i=0
while [ $running -eq 1 ]; do
procs=$(./status | grep java)
if [ -z $procs ]; then
running=0
elif [ $i -eq 4 ]; then
echo 'After 12 seconds, nodes are still running. Exiting.'
exit 1
else
sleep 3
i=$(($i + 1))
fi
done
if [ -n "$CSVFILE" ]; then
touch $CSVFILE
if [ 0 -eq $(ls -l $CSVFILE | cut -d" " -f5) ]; then
echo 'Configuration,Greedy,Number of nodes,Requests per node,IRD parameter (milliseconds),CSET parameter (milliseconds),Requests satisfied,Network active time (seconds),Network throughput (requests per second),Messages sent,Average response time (milliseconds)' > $CSVFILE
fi
fi
timestamps=$(./outerr | grep Granting | uniq | wc | sed 's/^[\t ]*//g' | cut -d" " -f1)
if [ $timestamps -eq $total ]; then
echo Checks passed.
echo Configuration: $(cat $PROJDIR/.configtemp)
echo Number of nodes: $nodes
echo Requests per node: $mesgs
echo Inter-request delay parameter '('milliseconds')': $ird
echo Critical section time parameter '('milliseconds')': $cset
echo Requests satisfied: $timestamps
exectime=$(./kernouterr | grep active | head -1 | cut -d" " -f4)
echo Time network was active '('seconds')': $exectime
echo 'Throughput (requests per second):' $(($total / $exectime))
totalsent=$(./kernouterr | grep Messages | cut -d" " -f3 | awk '{s+=$1} END {print s}')
echo Messages sent: $totalsent
totalresponsetime=$(./appouterr | grep Response | cut -d" " -f 3 | awk '{s+=$1} END {print s}')
echo Average response time '('milliseconds')': $(($totalresponsetime / $timestamps))
if [ -n "$CSVFILE" ]; then
echo -n $(cat $PROJDIR/.configtemp), >> $CSVFILE
echo -n $(cat $PROJDIR/.greedytemp), >> $CSVFILE
echo -n $nodes, >> $CSVFILE
echo -n $mesgs, >> $CSVFILE
echo -n $ird, >> $CSVFILE
echo -n $cset, >> $CSVFILE
echo -n $timestamps, >> $CSVFILE
echo -n $exectime, >> $CSVFILE
echo -n $(($total / $exectime)), >> $CSVFILE
echo -n $totalsent, >> $CSVFILE
echo $(($totalresponsetime / $timestamps)) >> $CSVFILE
fi
else
echo The number of timestamps '('$timestamps')' did not match the expected number '('$total')'.
exit 1
fi
)