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='array chase 40962dconv 2048mmver moldynverC 2500fft2d 10lookup rainforest'
7 LOGDIR=~/research/Robust/src/Benchmarks/Prefetch/runlog
14 while [ $i -lt $1 ]; do
15 echo "$DIR" > ~/.tmpdir
16 echo "bin=$3" > ~/.tmpvars
19 for j in $MACHINELIST; do
20 if [ $ct -lt $2 ]; then
21 if [ "$j" != "$HOSTNAME" ]; then
22 MACHINES="$MACHINES $j"
29 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
32 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
36 ln -s ${DSTMDIR}/dstm_3.conf dstm.conf
40 ln -s ${DSTMDIR}/dstm_4.conf dstm.conf
44 ln -s ${DSTMDIR}/dstm_5.conf dstm.conf
48 ln -s ${DSTMDIR}/dstm_6.conf dstm.conf
52 ln -s ${DSTMDIR}/dstm_7.conf dstm.conf
56 ln -s ${DSTMDIR}/dstm_8.conf dstm.conf
59 for machine in `echo $MACHINES`
61 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; ./$bin' &
65 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
66 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
67 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
68 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
69 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
70 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
71 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
72 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
73 echo "Terminating ... "
74 for machine in `echo $MACHINES`
76 ssh ${machine} 'source ~/.tmpvars; killall $bin'
83 function runallstats {
87 while [ $i -lt $1 ]; do
88 echo "$DIR" > ~/.tmpdir
89 echo "bin=$3" > ~/.tmpvars
92 for j in $MACHINELIST; do
93 if [ $ct -lt $2 ]; then
94 if [ "$j" != "$HOSTNAME" ]; then
95 MACHINES="$MACHINES $j"
102 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
103 if [ $2 -eq 2 ]; then
105 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
107 if [ $2 -eq 3 ]; then
109 ln -s ${DSTMDIR}/dstm_3.conf dstm.conf
111 if [ $2 -eq 4 ]; then
113 ln -s ${DSTMDIR}/dstm_4.conf dstm.conf
115 if [ $2 -eq 5 ]; then
117 ln -s ${DSTMDIR}/dstm_5.conf dstm.conf
119 if [ $2 -eq 6 ]; then
121 ln -s ${DSTMDIR}/dstm_6.conf dstm.conf
123 if [ $2 -eq 7 ]; then
125 ln -s ${DSTMDIR}/dstm_7.conf dstm.conf
127 if [ $2 -eq 8 ]; then
129 ln -s ${DSTMDIR}/dstm_8.conf dstm.conf
132 for machine in `echo $MACHINES`
134 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; /usr/bin/time -f "%e" ./$bin 2>> ./clienttime_`hostname | cut -f1 -d"."`.txt' &
138 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
139 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
140 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
141 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
142 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
143 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
144 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
145 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
146 echo "Terminating ... "
148 for machine in `echo $MACHINES`
150 if [ "$machine" != "$HOSTNAME" ]; then
151 ssh ${machine} '~/research/Robust/src/Benchmarks/Prefetch/killallclients.sh'
152 #ssh ${machine} 'source ~/.tmpvars; binpid=`ps aux | grep $bin | grep time | sed 's/[ ]./:/g' | sed 's/::/:/g' | cut -f2 -d":"`;kill -USR1 $binpid'
164 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
166 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
168 while [ $i -lt $1 ]; do
169 echo "$DIR" > ~/.tmpdir
170 echo "bin=$3" > ~/.tmpvars
171 echo "arg='$ARGS1'" > ~/.tmpargs
172 echo "logd=$LOGDIR" > ~/.tmplogdir
173 echo "ext=$EXTENSION" > ~/.tmpext
175 ssh dc-2.calit2.uci.edu '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'
176 echo "Terminating ... "
186 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
188 ln -s ${DSTMDIR}/dstm_1.conf dstm.conf
190 while [ $i -lt $1 ]; do
191 /usr/bin/time -f "%e" ./${NONPREFETCH_NONCACHE} master $ARGS1 2> ${LOGDIR}/tmp
192 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_local_${EXTENSION}.txt
193 if [ $i -eq 0 ];then echo "<h3> Benchmark=${NONPREFETCH_NONCACHE} Thread=1local Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html ;fi
194 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
195 echo "<br>" >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
202 PREFETCH=${BENCHMARK}N.bin
203 NONPREFETCH=${BENCHMARK}NPC.bin
204 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
205 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
209 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
212 # echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
213 # oneremote 1 1 $NONPREFETCH_NONCACHE
214 # echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
215 # oneremote 1 1 $NONPREFETCH
216 # echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
217 # oneremote 1 1 $PREFETCH
222 echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
223 run 10 $count $NONPREFETCH_NONCACHE
224 echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
225 run 10 $count $NONPREFETCH
226 #echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
227 #run 1 $count $PREFETCH
228 echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
229 run 10 $count $MANUAL_PREFETCH
232 #echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
233 #runallstats 1 $count $NONPREFETCH_NONCACHE
234 #echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
235 #runallstats 1 $count $NONPREFETCH
236 #echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
237 #runallstats 1 $count $PREFETCH
238 #echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
239 #runallstats 1 $count $MANUAL_PREFETCH
247 function callrunjavasingle {
248 JAVASINGLE=${BENCHMARK}.bin
252 echo "-----------Running javasingle for ${BENCHMARK} version ${EXTENSION} on 1 machines ------------"
257 function javasinglerun {
259 while [ $i -lt $1 ]; do
260 /usr/bin/time -f "%e" ./${BENCHMARK}.bin $ARGS1 2> ${LOGDIR}/tmp
261 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_javasingle_${EXTENSION}.txt
262 if [ $i -eq 0 ];then echo "<h3> Benchmark=${BENCHMARK} Thread=1java Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html ;fi
263 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
264 echo "<br>" >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
270 function callmicrorun {
271 PREFETCH=${BENCHMARK}N.bin
272 NONPREFETCH=${BENCHMARK}NPC.bin
273 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
274 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
277 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
279 echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
280 oneremote 10 1 $NONPREFETCH_NONCACHE
281 echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
282 oneremote 10 1 $NONPREFETCH
283 # echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
284 # oneremote 10 1 $PREFETCH
285 echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
286 oneremote 1 1 $MANUAL_PREFETCH
291 echo "---------- Clean old files ---------- "
293 for b in `echo $benchmarks`
296 BENCHMARK=`echo $bm | cut -f1 -d":"`
297 BMDIR=`echo $bm | cut -f2 -d":"`
298 ARGS1=`echo $bm | cut -f3 -d":"`
299 ARGS2=`echo $bm | cut -f4 -d":"`
300 ARGS3=`echo $bm | cut -f5 -d":"`
301 ARGS4=`echo $bm | cut -f6 -d":"`
302 ARGS5=`echo $bm | cut -f7 -d":"`
303 ARGS6=`echo $bm | cut -f8 -d":"`
304 ARGS7=`echo $bm | cut -f9 -d":"`
305 ARGS8=`echo $bm | cut -f10 -d":"`
306 EXTENSION=`echo $bm | cut -f11 -d":"`
309 if [ $b == $name1 ] || [ $b == $name2 ]; then
317 #----------Calulates the averages -----------
318 for file in `ls runlog/*.txt`
320 echo -n $file >> average.txt
321 cat $file | grep -v "^Command" | awk '{sum += $1} END {print " "sum/NR}' >> average.txt
323 echo "===========" >> average.txt
324 echo "" >> average.txt