4 MACHINELIST='dc-1.calit2.uci.edu dc-2.calit2.uci.edu dc-3.calit2.uci.edu dc-4.calit2.uci.edu dc-5.calit2.uci.edu dc-6.calit2.uci.edu dc-7.calit2.uci.edu dc-8.calit2.uci.edu'
5 #benchmarks='40962dconv 1200mmver moldynverB 1600fft2d 1152fft2d 10lookup rainforest'
6 #benchmarks='40962dconv'
8 #benchmarks='rainforest'
9 #benchmarks='1152fft2d'
10 benchmarks='moldynverC'
11 #benchmarks='40962dconv 1200mmver 1152fft2d moldynverA 10lookup rainforest'
13 LOGDIR=~/research/Robust/src/Benchmarks/Prefetch/runlog
20 while [ $i -lt $1 ]; do
21 echo "$DIR" > ~/.tmpdir
22 echo "bin=$3" > ~/.tmpvars
25 for j in $MACHINELIST; do
26 if [ $ct -lt $2 ]; then
27 if [ "$j" != "$HOSTNAME" ]; then
28 MACHINES="$MACHINES $j"
35 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
38 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
42 ln -s ${DSTMDIR}/dstm_3.conf dstm.conf
46 ln -s ${DSTMDIR}/dstm_4.conf dstm.conf
50 ln -s ${DSTMDIR}/dstm_5.conf dstm.conf
54 ln -s ${DSTMDIR}/dstm_6.conf dstm.conf
58 ln -s ${DSTMDIR}/dstm_7.conf dstm.conf
62 ln -s ${DSTMDIR}/dstm_8.conf dstm.conf
65 for machine in `echo $MACHINES`
67 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; ./$bin' &
71 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
72 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
73 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
74 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
75 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
76 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
77 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
78 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
79 echo "Terminating ... "
80 for machine in `echo $MACHINES`
82 ssh ${machine} 'source ~/.tmpvars; killall $bin'
89 function runallstats {
93 while [ $i -lt $1 ]; do
94 echo "$DIR" > ~/.tmpdir
95 echo "bin=$3" > ~/.tmpvars
98 for j in $MACHINELIST; do
99 if [ $ct -lt $2 ]; then
100 if [ "$j" != "$HOSTNAME" ]; then
101 MACHINES="$MACHINES $j"
108 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
109 if [ $2 -eq 2 ]; then
111 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
113 if [ $2 -eq 3 ]; then
115 ln -s ${DSTMDIR}/dstm_3.conf dstm.conf
117 if [ $2 -eq 4 ]; then
119 ln -s ${DSTMDIR}/dstm_4.conf dstm.conf
121 if [ $2 -eq 5 ]; then
123 ln -s ${DSTMDIR}/dstm_5.conf dstm.conf
125 if [ $2 -eq 6 ]; then
127 ln -s ${DSTMDIR}/dstm_6.conf dstm.conf
129 if [ $2 -eq 7 ]; then
131 ln -s ${DSTMDIR}/dstm_7.conf dstm.conf
133 if [ $2 -eq 8 ]; then
135 ln -s ${DSTMDIR}/dstm_8.conf dstm.conf
138 for machine in `echo $MACHINES`
140 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; ./$bin' &
144 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
145 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
146 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
147 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
148 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
149 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
150 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
151 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
152 echo "Terminating ... "
156 for machine in `echo $MACHINES`
158 if [ "$machine" != "$HOSTNAME" ]; then
159 ssh ${machine} 'source ~/.tmpvars; binpid=`ps aux | grep $bin | grep -v grep | cut -f2`; kill -USR1 $binpid'
170 while [ $i -lt $1 ]; do
171 echo "$DIR" > ~/.tmpdir
172 echo "bin=$3" > ~/.tmpvars
173 echo "arg='$ARGS1'" > ~/.tmpargs
174 echo "logd=$LOGDIR" > ~/.tmplogdir
175 echo "ext=$EXTENSION" > ~/.tmpext
177 ssh $MACHINES2 'cd `cat ~/.tmpdir`; source ~/.tmpvars; source ~/.tmpargs; source ~/.tmplogdir; source ~/.tmpext; /usr/bin/time -f "%e" ./$bin master $arg 2>> ${logd}/${bin}_remote_${ext}.txt'
178 echo "Terminating ... "
187 #while [ $i -lt $1 ]; do
188 # /usr/bin/time -f "%e" ./${NONPREFETCH} master $ARGS1 2>> ${LOGDIR}/${NONPREFETCH}_local_${EXTENSION}.txt
194 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
196 ln -s ${DSTMDIR}/dstm_1.conf dstm.conf
198 while [ $i -lt $1 ]; do
199 /usr/bin/time -f "%e" ./${NONPREFETCH_NONCACHE} master $ARGS1 2> ${LOGDIR}/tmp
200 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_local_${EXTENSION}.txt
201 if [ $i -eq 0 ];then echo "<h3> Benchmark=${NONPREFETCH_NONCACHE} Thread=1local Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html ;fi
202 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
203 echo "<br>" >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
210 PREFETCH=${BENCHMARK}N.bin
211 NONPREFETCH=${BENCHMARK}NPC.bin
212 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
213 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
217 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
220 # echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
221 # oneremote 1 1 $NONPREFETCH_NONCACHE
222 # echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
223 # oneremote 1 1 $NONPREFETCH
224 # echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
225 # oneremote 1 1 $PREFETCH
230 echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
231 run 1 $count $NONPREFETCH_NONCACHE
232 echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
233 run 1 $count $NONPREFETCH
234 #echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
235 #run 1 $count $PREFETCH
236 echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
237 run 1 $count $MANUAL_PREFETCH
240 #echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
241 #runallstats 1 $count $NONPREFETCH_NONCACHE
242 #echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
243 #runallstats 1 $count $NONPREFETCH
244 #echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
245 #runallstats 1 $count $PREFETCH
246 #echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
247 #runallstats 1 $count $MANUAL_PREFETCH
255 function callrunjavasingle {
256 JAVASINGLE=${BENCHMARK}.bin
260 echo "-----------Running javasingle for ${BENCHMARK} version ${EXTENSION} on 1 machines ------------"
265 function javasinglerun {
267 while [ $i -lt $1 ]; do
268 /usr/bin/time -f "%e" ./${BENCHMARK}.bin $ARGS1 2> ${LOGDIR}/tmp
269 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_javasingle_${EXTENSION}.txt
270 if [ $i -eq 0 ];then echo "<h3> Benchmark=${BENCHMARK} Thread=1java Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html ;fi
271 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
272 echo "<br>" >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
278 function callmicrorun {
279 PREFETCH=${BENCHMARK}1.bin
280 NONPREFETCH=${BENCHMARK}1NP.bin
281 NONPREFETCH_NONCACHE=${BENCHMARK}1NPNC.bin
283 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
285 echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
286 oneremote 10 1 $NONPREFETCH_NONCACHE
287 echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
288 oneremote 10 1 $NONPREFETCH
289 echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
290 oneremote 10 1 $PREFETCH
295 echo "---------- Clean old files ---------- "
297 for b in `echo $benchmarks`
300 BENCHMARK=`echo $bm | cut -f1 -d":"`
301 BMDIR=`echo $bm | cut -f2 -d":"`
302 ARGS1=`echo $bm | cut -f3 -d":"`
303 ARGS2=`echo $bm | cut -f4 -d":"`
304 ARGS3=`echo $bm | cut -f5 -d":"`
305 ARGS4=`echo $bm | cut -f6 -d":"`
306 ARGS5=`echo $bm | cut -f7 -d":"`
307 ARGS6=`echo $bm | cut -f8 -d":"`
308 ARGS7=`echo $bm | cut -f9 -d":"`
309 ARGS8=`echo $bm | cut -f10 -d":"`
310 EXTENSION=`echo $bm | cut -f11 -d":"`
313 if [ $b == $name1 ] || [ $b == $name2 ]; then
321 #----------Calulates the averages -----------
322 for file in `ls runlog/*.txt`
324 echo -n $file >> average.txt
325 cat $file | grep -v "^Command" | awk '{sum += $1} END {print " "sum/NR}' >> average.txt
327 echo "===========" >> average.txt
328 echo "" >> average.txt