From 3c3146de15579c7aca8052efba595d2b9f826754 Mon Sep 17 00:00:00 2001 From: adash Date: Mon, 9 Mar 2009 17:53:19 +0000 Subject: [PATCH] script to run manual prefetches bm.txt file has the arguments for each benchmark --- .../Benchmarks/Prefetch/ManualPrefetch/bm.txt | 3 + .../Benchmarks/Prefetch/ManualPrefetch/run.sh | 165 ++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 Robust/src/Benchmarks/Prefetch/ManualPrefetch/bm.txt create mode 100755 Robust/src/Benchmarks/Prefetch/ManualPrefetch/run.sh diff --git a/Robust/src/Benchmarks/Prefetch/ManualPrefetch/bm.txt b/Robust/src/Benchmarks/Prefetch/ManualPrefetch/bm.txt new file mode 100644 index 00000000..49525967 --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/ManualPrefetch/bm.txt @@ -0,0 +1,3 @@ +RainForest:RainForest:-N 1:-N 2:-N 3:-N 4:-N 5:-N 6:-N 7:-N 8:rainforest +LookUpService:LookUpService:-N 1 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 2 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 3 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 4 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 5 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 6 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 7 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:-N 8 -nEntry 160 -nTrans 1000 -probRead 96 -nLookUp 10:10lookup +MatrixMultiply:MatrixMultiply:1 800:2 800:3 800:4 800:5 800:6 800:7 800:8 800:800mmver diff --git a/Robust/src/Benchmarks/Prefetch/ManualPrefetch/run.sh b/Robust/src/Benchmarks/Prefetch/ManualPrefetch/run.sh new file mode 100755 index 00000000..b39d4b32 --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/ManualPrefetch/run.sh @@ -0,0 +1,165 @@ +#!/bin/sh + +#set -x +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' +#benchmarks='40962dconv 1200mmver moldynverB' +#benchmarks='10lookup' + +LOGDIR=~/research/Robust/src/Benchmarks/Prefetch/ManualPrefetch/runlog +TOPDIR=`pwd` + +function run { + i=0; + DIR=`pwd` + HOSTNAME=`hostname` + while [ $i -lt $1 ]; do + echo "$DIR" > ~/.tmpdir + echo "bin=$3" > ~/.tmpvars + ct=0 + MACHINES='' + for j in $MACHINELIST; do + if [ $ct -lt $2 ]; then + if [ "$j" != "$HOSTNAME" ]; then + MACHINES="$MACHINES $j" + fi + fi + let ct=$ct+1 + done + + rm dstm.conf + DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config + if [ $2 -eq 2 ]; then + arg=$ARGS2 + ln -s ${DSTMDIR}/dstm_2.conf dstm.conf + fi + if [ $2 -eq 3 ]; then + arg=$ARGS3 + ln -s ${DSTMDIR}/dstm_3.conf dstm.conf + fi + if [ $2 -eq 4 ]; then + arg=$ARGS4 + ln -s ${DSTMDIR}/dstm_4.conf dstm.conf + fi + if [ $2 -eq 5 ]; then + arg=$ARGS5 + ln -s ${DSTMDIR}/dstm_5.conf dstm.conf + fi + if [ $2 -eq 6 ]; then + arg=$ARGS6 + ln -s ${DSTMDIR}/dstm_6.conf dstm.conf + fi + if [ $2 -eq 7 ]; then + arg=$ARGS7 + ln -s ${DSTMDIR}/dstm_7.conf dstm.conf + fi + if [ $2 -eq 8 ]; then + arg=$ARGS8 + ln -s ${DSTMDIR}/dstm_8.conf dstm.conf + fi + chmod +x ~/.tmpvars + for machine in `echo $MACHINES` + do + ssh ${machine} 'cd `cat ~/.tmpdir`; source ~/.tmpvars; ./$bin' & + echo "" + done + sleep 2 +# perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl clear_stats settings=switch/clearsettings.txt + /usr/bin/time -f "%e" ./$3 master $arg 2> ${LOGDIR}/tmp +# perl -x${TOPDIR} ${TOPDIR}/switch/fetch_stat.pl settings=switch/settings.txt + cat ${LOGDIR}/tmp >> ${LOGDIR}/${2}Thrd_${3}_${EXTENSION}.txt + if [ $i -eq 0 ];then echo "

Benchmark=${3} Thread=${2} Extension=${EXTENSION}


" > ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html ;fi + cat ${LOGDIR}/tmp >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html +# echo "Network Stats
" >> ${LOGDIR}/${3}_${EXTENSION}_${2}Thrd_a.html +# mv ${TOPDIR}/html/dell.html ${LOGDIR}/${2}Thrd_${3}_${EXTENSION}_${i}.html + echo "Terminating ... " + for machine in `echo $MACHINES` + do + ssh ${machine} 'source ~/.tmpvars; killall $bin' + done + sleep 2 + i=`expr $i + 1` + done +} + +function oneremote { + i=0; + DIR=`pwd` + while [ $i -lt $1 ]; do + echo "$DIR" > ~/.tmpdir + echo "bin=$3" > ~/.tmpvars + echo "arg='$ARGS1'" > ~/.tmpargs + echo "logd=$LOGDIR" > ~/.tmplogdir + echo "ext=$EXTENSION" > ~/.tmpext + ./$3 & + 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' + echo "Terminating ... " + killall $3 + sleep 2 + i=`expr $i + 1` + done +} + +function localrun { + rm dstm.conf + DSTMDIR=${HOME}/research/Robust/src/Benchmarks/Prefetch/config + ln -s ${DSTMDIR}/dstm_1.conf dstm.conf + i=0; + while [ $i -lt $1 ]; do + /usr/bin/time -f "%e" ./${MANUAL_PREFETCH} master $ARGS1 2> ${LOGDIR}/tmp + cat ${LOGDIR}/tmp >> ${LOGDIR}/${MANUAL_PREFETCH}_local_${EXTENSION}.txt +# if [ $i -eq 0 ];then echo "

Benchmark=${NONPREFETCH_NONCACHE} Thread=1local Extension=${EXTENSION}


" > ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html ;fi +# cat ${LOGDIR}/tmp >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html +# echo "
" >> ${LOGDIR}/${NONPREFETCH_NONCACHE}_${EXTENSION}_1local_a.html + sleep 2 + i=`expr $i + 1` + done +} + +function callrun { + MANUAL_PREFETCH=${BENCHMARK}RangeN.bin + + cd $BMDIR + + echo "---------- Running local $BMDIR non-prefetch on 1 machine ---------- " + localrun 1 + +for count in 2 4 6 8 +do +echo "------- Running $count threads $BMDIR manual prefetch on $count machines -----" +run 1 $count $MANUAL_PREFETCH +done + +cd $TOPDIR +} + + +benchmarks='rainforest' +echo "---------- Clean old files ---------- " +rm runlog/* +for b in `echo $benchmarks` +do + bm=`grep $b bm.txt` + BENCHMARK=`echo $bm | cut -f1 -d":"` + BMDIR=`echo $bm | cut -f2 -d":"` + ARGS1=`echo $bm | cut -f3 -d":"` + ARGS2=`echo $bm | cut -f4 -d":"` + ARGS3=`echo $bm | cut -f5 -d":"` + ARGS4=`echo $bm | cut -f6 -d":"` + ARGS5=`echo $bm | cut -f7 -d":"` + ARGS6=`echo $bm | cut -f8 -d":"` + ARGS7=`echo $bm | cut -f9 -d":"` + ARGS8=`echo $bm | cut -f10 -d":"` + EXTENSION=`echo $bm | cut -f11 -d":"` + callrun +done + +#----------Calulates the averages ----------- +for file in `ls runlog/*.txt` +do + echo -n $file >> average.txt + cat $file | grep -v "^Command" | awk '{sum += $1} END {print " "sum/NR}' >> average.txt +done +echo "===========" >> average.txt +echo "" >> average.txt + +echo "done" -- 2.34.1