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 tree 65050mmver 15005fft2d moldynverB sorverD 1000010002dconv spamfilter2500 rainforest'
8 LOGDIR=~/research/Robust/src/Benchmarks/Prefetch/runlog
9 LOGDIR1=~/research/Robust/src/Benchmarks/Prefetch/logres
16 while [ $i -lt $1 ]; do
17 echo "$DIR" > ~/.tmpdir
18 echo "bin=$3" > ~/.tmpvars
21 for j in $MACHINELIST; do
22 if [ $ct -lt $2 ]; then
23 if [ "$j" != "$HOSTNAME" ]; then
24 MACHINES="$MACHINES $j"
31 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
34 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
38 ln -s ${DSTMDIR}/dstm_3.conf dstm.conf
42 ln -s ${DSTMDIR}/dstm_4.conf dstm.conf
46 ln -s ${DSTMDIR}/dstm_5.conf dstm.conf
50 ln -s ${DSTMDIR}/dstm_6.conf dstm.conf
54 ln -s ${DSTMDIR}/dstm_7.conf dstm.conf
58 ln -s ${DSTMDIR}/dstm_8.conf dstm.conf
61 for machine in `echo $MACHINES`
63 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; ./$bin' &
67 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
68 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
69 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
70 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
71 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
72 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
73 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
74 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
75 echo "Terminating ... "
76 for machine in `echo $MACHINES`
78 ssh ${machine} 'source ~/.tmpvars; killall $bin'
85 function runallstats {
89 while [ $i -lt $1 ]; do
90 echo "$DIR" > ~/.tmpdir
91 echo "bin=$3" > ~/.tmpvars
94 for j in $MACHINELIST; do
95 if [ $ct -lt $2 ]; then
96 if [ "$j" != "$HOSTNAME" ]; then
97 MACHINES="$MACHINES $j"
104 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
105 if [ $2 -eq 2 ]; then
107 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
109 if [ $2 -eq 3 ]; then
111 ln -s ${DSTMDIR}/dstm_3.conf dstm.conf
113 if [ $2 -eq 4 ]; then
115 ln -s ${DSTMDIR}/dstm_4.conf dstm.conf
117 if [ $2 -eq 5 ]; then
119 ln -s ${DSTMDIR}/dstm_5.conf dstm.conf
121 if [ $2 -eq 6 ]; then
123 ln -s ${DSTMDIR}/dstm_6.conf dstm.conf
125 if [ $2 -eq 7 ]; then
127 ln -s ${DSTMDIR}/dstm_7.conf dstm.conf
129 if [ $2 -eq 8 ]; then
131 ln -s ${DSTMDIR}/dstm_8.conf dstm.conf
133 envarg=`echo $arg | sed 's/ /_/g'`
134 FILENAME="${LOGDIR1}/${3}_${envarg}_thd_${2}_"
135 echo "$FILENAME" > ~/.tmpenvs
138 echo "args=$arg thds=${2}Thd" > ~/.tmpparams
139 for machine in `echo $MACHINES`
141 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; /usr/bin/time -f "%e" ./$bin 2>> ./clienttime_`hostname | cut -f1 -d"."`.txt' &
145 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
146 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
147 envtime=`cat ${LOGDIR}/tmp | grep -v Command`
148 echo "$envtime" >> ~/.tmpenvs
149 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
150 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
151 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
152 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
153 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
154 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
155 echo "Terminating ... "
157 for machine in `echo $MACHINES`
159 if [ "$machine" != "$HOSTNAME" ]; then
160 ssh ${machine} '~/research/Robust/src/Benchmarks/Prefetch/killallclients.sh'
161 #ssh ${machine} 'source ~/.tmpvars; binpid=`ps aux | grep $bin | grep time | sed 's/[ ]./:/g' | sed 's/::/:/g' | cut -f2 -d":"`;kill -USR1 $binpid'
173 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
175 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
177 while [ $i -lt $1 ]; do
178 echo "$DIR" > ~/.tmpdir
179 echo "bin=$3" > ~/.tmpvars
180 echo "arg='$ARGS1'" > ~/.tmpargs
181 echo "logd=$LOGDIR" > ~/.tmplogdir
182 echo "ext=$EXTENSION" > ~/.tmpext
184 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'
185 echo "Terminating ... "
195 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
197 ln -s ${DSTMDIR}/dstm_1.conf dstm.conf
199 while [ $i -lt $1 ]; do
200 /usr/bin/time -f "%e" ./${NONPREFETCH_NONCACHE} master $ARGS1 2> ${LOGDIR}/tmp
201 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_local_${EXTENSION}.txt
202 if [ $i -eq 0 ];then echo "<h3> Benchmark=${NONPREFETCH_NONCACHE} Thread=1local Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html ;fi
203 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
204 echo "<br>" >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
211 PREFETCH=${BENCHMARK}N.bin
212 NONPREFETCH=${BENCHMARK}NPC.bin
213 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
214 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
218 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
221 # echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
222 # oneremote 1 1 $NONPREFETCH_NONCACHE
223 # echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
224 # oneremote 1 1 $NONPREFETCH
225 # echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
226 # oneremote 1 1 $PREFETCH
231 echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
232 run 10 $count $NONPREFETCH_NONCACHE
233 echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
234 run 10 $count $NONPREFETCH
235 echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
236 run 10 $count $PREFETCH
237 #echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
238 #run 10 $count $MANUAL_PREFETCH
241 # echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
242 # runallstats 1 $count $NONPREFETCH_NONCACHE
243 #echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
244 #runallstats 1 $count $NONPREFETCH
245 # echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
246 # runallstats 1 $count $PREFETCH
247 #echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
248 #runallstats 1 $count $MANUAL_PREFETCH
256 function callrunjavasingle {
257 JAVASINGLE=${BENCHMARK}.bin
261 echo "-----------Running javasingle for ${BENCHMARK} version ${EXTENSION} on 1 machines ------------"
266 function javasinglerun {
268 while [ $i -lt $1 ]; do
269 /usr/bin/time -f "%e" ./${BENCHMARK}.bin $ARGS1 2> ${LOGDIR}/tmp
270 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_javasingle_${EXTENSION}.txt
271 if [ $i -eq 0 ];then echo "<h3> Benchmark=${BENCHMARK} Thread=1java Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html ;fi
272 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
273 echo "<br>" >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
279 function callmicrorun {
280 PREFETCH=${BENCHMARK}N.bin
281 NONPREFETCH=${BENCHMARK}NPC.bin
282 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
283 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
286 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
288 echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
289 oneremote 10 1 $NONPREFETCH_NONCACHE
290 # echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
291 # oneremote 10 1 $NONPREFETCH
292 echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
293 oneremote 10 1 $PREFETCH
294 # echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
295 # oneremote 1 1 $MANUAL_PREFETCH
300 echo "---------- Clean old files ---------- "
302 mv runlog/* runlog/results/.
304 for b in `echo $benchmarks`
307 BENCHMARK=`echo $bm | cut -f1 -d":"`
308 BMDIR=`echo $bm | cut -f2 -d":"`
309 ARGS1=`echo $bm | cut -f3 -d":"`
310 ARGS2=`echo $bm | cut -f4 -d":"`
311 ARGS3=`echo $bm | cut -f5 -d":"`
312 ARGS4=`echo $bm | cut -f6 -d":"`
313 ARGS5=`echo $bm | cut -f7 -d":"`
314 ARGS6=`echo $bm | cut -f8 -d":"`
315 ARGS7=`echo $bm | cut -f9 -d":"`
316 ARGS8=`echo $bm | cut -f10 -d":"`
317 EXTENSION=`echo $bm | cut -f11 -d":"`
321 if [ $b == $name1 ] || [ $b == $name2 ] || [ $b == $name3 ]; then
329 #----------Calulates the averages -----------
330 for file in `ls runlog/*.txt`
332 echo -n $file >> average.txt
333 cat $file | grep -v "^Command" | awk '{sum += $1} END {print " "sum/NR}' >> average.txt
335 echo "===========" >> average.txt
336 echo "" >> average.txt