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 60050mmver moldynverB 2000fft2d 40962dconv sorverD 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 echo "args=$arg thds=${2}Thd" > ~/.tmpparams
133 for machine in `echo $MACHINES`
135 ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; /usr/bin/time -f "%e" ./$bin 2>> ./clienttime_`hostname | cut -f1 -d"."`.txt' &
139 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt
140 /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp
141 perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt
142 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}.txt
143 if [ $i -eq 0 ];then echo "<h3> Benchmark=${3} Thread=${2} Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi
144 cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
145 echo "<a href=\"${3}_${2}Thrd_${EXTENSION}_${i}.html\">Network Stats</a><br>" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html
146 mv ${TOPDIR}/html/dell.html ${LOGDIR}/${3}_${2}Thrd_${EXTENSION}_${i}.html
147 echo "Terminating ... "
149 for machine in `echo $MACHINES`
151 if [ "$machine" != "$HOSTNAME" ]; then
152 ssh ${machine} '~/research/Robust/src/Benchmarks/Prefetch/killallclients.sh'
153 #ssh ${machine} 'source ~/.tmpvars; binpid=`ps aux | grep $bin | grep time | sed 's/[ ]./:/g' | sed 's/::/:/g' | cut -f2 -d":"`;kill -USR1 $binpid'
165 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
167 ln -s ${DSTMDIR}/dstm_2.conf dstm.conf
169 while [ $i -lt $1 ]; do
170 echo "$DIR" > ~/.tmpdir
171 echo "bin=$3" > ~/.tmpvars
172 echo "arg='$ARGS1'" > ~/.tmpargs
173 echo "logd=$LOGDIR" > ~/.tmplogdir
174 echo "ext=$EXTENSION" > ~/.tmpext
176 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'
177 echo "Terminating ... "
187 DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config
189 ln -s ${DSTMDIR}/dstm_1.conf dstm.conf
191 while [ $i -lt $1 ]; do
192 /usr/bin/time -f "%e" ./${NONPREFETCH_NONCACHE} master $ARGS1 2> ${LOGDIR}/tmp
193 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_local_${EXTENSION}.txt
194 if [ $i -eq 0 ];then echo "<h3> Benchmark=${NONPREFETCH_NONCACHE} Thread=1local Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html ;fi
195 cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
196 echo "<br>" >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html
203 PREFETCH=${BENCHMARK}N.bin
204 NONPREFETCH=${BENCHMARK}NPC.bin
205 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
206 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
210 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
213 # echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
214 # oneremote 1 1 $NONPREFETCH_NONCACHE
215 # echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
216 # oneremote 1 1 $NONPREFETCH
217 # echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
218 # oneremote 1 1 $PREFETCH
223 echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
224 run 10 $count $NONPREFETCH_NONCACHE
225 #echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
226 #run 10 $count $NONPREFETCH
227 echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
228 run 10 $count $PREFETCH
229 #echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
230 #run 10 $count $MANUAL_PREFETCH
233 #echo "------- Running $count threads $BMDIR non-prefetch + non-cache on $count machines -----"
234 #runallstats 1 $count $NONPREFETCH_NONCACHE
235 #echo "------- Running $count threads $BMDIR non-prefetch on $count machines -----"
236 #runallstats 1 $count $NONPREFETCH
237 #echo "------- Running $count threads $BMDIR normal prefetch on $count machines -----"
238 #runallstats 1 $count $PREFETCH
239 #echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
240 #runallstats 1 $count $MANUAL_PREFETCH
248 function callrunjavasingle {
249 JAVASINGLE=${BENCHMARK}.bin
253 echo "-----------Running javasingle for ${BENCHMARK} version ${EXTENSION} on 1 machines ------------"
258 function javasinglerun {
260 while [ $i -lt $1 ]; do
261 /usr/bin/time -f "%e" ./${BENCHMARK}.bin $ARGS1 2> ${LOGDIR}/tmp
262 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_javasingle_${EXTENSION}.txt
263 if [ $i -eq 0 ];then echo "<h3> Benchmark=${BENCHMARK} Thread=1java Extension=${EXTENSION}</h3><br>" > ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html ;fi
264 cat ${LOGDIR}/tmp >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
265 echo "<br>" >> ${LOGDIR}/${BENCHMARK}_${EXTENSION}_1java_a.html
271 function callmicrorun {
272 PREFETCH=${BENCHMARK}N.bin
273 NONPREFETCH=${BENCHMARK}NPC.bin
274 NONPREFETCH_NONCACHE=${BENCHMARK}NPNC.bin
275 MANUAL_PREFETCH=${BENCHMARK}RangeN.bin
278 echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- "
280 echo "---------- Running single thread remote $BMDIR non-prefetch + non-cache on 2 machines ---------- "
281 oneremote 10 1 $NONPREFETCH_NONCACHE
282 # echo "---------- Running single thread remote $BMDIR non-prefetch on 2 machines ---------- "
283 # oneremote 10 1 $NONPREFETCH
284 echo "---------- Running single thread remote $BMDIR prefetch on 2 machines ---------- "
285 oneremote 10 1 $PREFETCH
286 # echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----"
287 # oneremote 1 1 $MANUAL_PREFETCH
292 echo "---------- Clean old files ---------- "
294 mv runlog/* runlog/results/.
295 for b in `echo $benchmarks`
298 BENCHMARK=`echo $bm | cut -f1 -d":"`
299 BMDIR=`echo $bm | cut -f2 -d":"`
300 ARGS1=`echo $bm | cut -f3 -d":"`
301 ARGS2=`echo $bm | cut -f4 -d":"`
302 ARGS3=`echo $bm | cut -f5 -d":"`
303 ARGS4=`echo $bm | cut -f6 -d":"`
304 ARGS5=`echo $bm | cut -f7 -d":"`
305 ARGS6=`echo $bm | cut -f8 -d":"`
306 ARGS7=`echo $bm | cut -f9 -d":"`
307 ARGS8=`echo $bm | cut -f10 -d":"`
308 EXTENSION=`echo $bm | cut -f11 -d":"`
312 if [ $b == $name1 ] || [ $b == $name2 ] || [ $b == $name3 ]; then
320 #----------Calulates the averages -----------
321 for file in `ls runlog/*.txt`
323 echo -n $file >> average.txt
324 cat $file | grep -v "^Command" | awk '{sum += $1} END {print " "sum/NR}' >> average.txt
326 echo "===========" >> average.txt
327 echo "" >> average.txt