From fc6d51d0fc3295a36fcc211693d461915be5b7f8 Mon Sep 17 00:00:00 2001 From: jihoonl Date: Thu, 18 Feb 2010 02:05:52 +0000 Subject: [PATCH] change --- .../MatrixMultiply/java/MatrixMultiply.java | 7 +- .../recovery/MatrixMultiply.java | 14 ++-- .../MatrixMultiply/recovery/dstm.conf | 2 +- .../SpamFilter/recovery/SpamFilter.java | 4 +- .../Recovery/Spider/recovery/QueryTask.java | 2 + Robust/src/Benchmarks/Recovery/bm_args.txt | 3 + Robust/src/Benchmarks/Recovery/runjava.sh | 75 ++++++++++++------- 7 files changed, 66 insertions(+), 41 deletions(-) diff --git a/Robust/src/Benchmarks/Recovery/MatrixMultiply/java/MatrixMultiply.java b/Robust/src/Benchmarks/Recovery/MatrixMultiply/java/MatrixMultiply.java index c8ebd087..1c6f4ed2 100644 --- a/Robust/src/Benchmarks/Recovery/MatrixMultiply/java/MatrixMultiply.java +++ b/Robust/src/Benchmarks/Recovery/MatrixMultiply/java/MatrixMultiply.java @@ -112,12 +112,13 @@ public class MatrixMultiply { MMul matrix; MatrixMultiply mm; - if (args.length == 3) { + if (args.length == 2) { SIZE = Integer.parseInt(args[0]); increment = Integer.parseInt(args[1]); // size of subtask } else { System.out.println("usage: ./MatrixMultiply.bin "); + System.exit(0); } matrix = new MMul(SIZE, SIZE, SIZE); @@ -169,14 +170,14 @@ public class MMul{ for(int i = 0; i < L; i++) { double ai[] = a[i]; for(int j = 0; j < M; j++) { - ai[j] = j+1; + ai[j] = 1; } } for(int i = 0; i < M; i++) { double bi[] = b[i]; for(int j = 0; j < N; j++) { - bi[j] = j+1; + bi[j] = 1; } } diff --git a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java index 86bedf43..cbca98a3 100644 --- a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java +++ b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java @@ -56,6 +56,7 @@ public class MatrixMultiply extends Task { int x1; int size; + // get matrix atomic { seg = (Segment)myWork; @@ -89,6 +90,7 @@ public class MatrixMultiply extends Task { mmul.c[i][j] = lc[i][j]; } } + } } @@ -127,9 +129,9 @@ public class MatrixMultiply extends Task { } int[] mid = new int[8]; - mid[0] = (128<<24)|(195<<16)|(180<<8)|21; //dw-2 - mid[1] = (128<<24)|(195<<16)|(180<<8)|26; //dw-7 -/* mid[2] = (128<<24)|(195<<16)|(180<<8)|26; //dw-7 +/* mid[0] = (128<<24)|(195<<16)|(180<<8)|21; //dw-2 + mid[1] = (128<<24)|(195<<16)|(180<<8)|26; //dw-7*/ + mid[2] = (128<<24)|(195<<16)|(180<<8)|26; //dw-7 mid[0] = (128<<24)|(195<<16)|(136<<8)|162; //dc1 mid[1] = (128<<24)|(195<<16)|(136<<8)|163; //dc2 mid[2] = (128<<24)|(195<<16)|(136<<8)|164; //dc3 @@ -138,7 +140,7 @@ public class MatrixMultiply extends Task { mid[5] = (128<<24)|(195<<16)|(136<<8)|167; //dc6 mid[6] = (128<<24)|(195<<16)|(136<<8)|168; //dc7 mid[7] = (128<<24)|(195<<16)|(136<<8)|169; //dc8 -*/ + atomic { matrix = global new MMul(SIZE, SIZE, SIZE); matrix.setValues(); @@ -183,7 +185,7 @@ public class MatrixMultiply extends Task { } public void output() { - System.out.println("Sum = " + mmul.getSum()); + System.out.println("c[0][0] = " + mmul.c[0][0] + " c["+(SIZE-1)+"]["+(SIZE-1)+"] : " + mmul.c[SIZE-1][SIZE-1]); } } @@ -216,7 +218,7 @@ public class MMul{ for(int i = 0; i < M; i++) { double bi[] = b[i]; for(int j = 0; j < N; j++) { - bi[j] = j+1; + bi[j] = j+ 1; } } diff --git a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/dstm.conf b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/dstm.conf index 372ad1aa..35fab289 100644 --- a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/dstm.conf +++ b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/dstm.conf @@ -1,5 +1,5 @@ 128.195.180.21 -128.195.180.26 +#128.195.180.26 #128.195.136.162 #128.195.136.163 #128.195.136.164 diff --git a/Robust/src/Benchmarks/Recovery/SpamFilter/recovery/SpamFilter.java b/Robust/src/Benchmarks/Recovery/SpamFilter/recovery/SpamFilter.java index ae8476e3..085f473f 100644 --- a/Robust/src/Benchmarks/Recovery/SpamFilter/recovery/SpamFilter.java +++ b/Robust/src/Benchmarks/Recovery/SpamFilter/recovery/SpamFilter.java @@ -108,10 +108,10 @@ public class SpamFilter extends Thread { //diff = stop-start; // System.out.println("time to complete iteration" + j + " = " + diff + " millisecs"); } //end num emails - System.out.println((i+1)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails)); +// System.out.println((i+1)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails)); }//end num iter // Sanity check -// System.out.println((i)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails)); + System.out.println((i)+"th iteration correct = " + correct + " Wrong = " + wrong + " percentage = " + ((float)correct/(float)nemails)); System.out.println("\n\n\n I'm Done\n\n\n"); RecoveryStat.printRecoveryStat(); diff --git a/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java b/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java index 7113e451..7b4c3f8f 100644 --- a/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java +++ b/Robust/src/Benchmarks/Recovery/Spider/recovery/QueryTask.java @@ -138,6 +138,8 @@ public class QueryTask extends Task { String str; Iterator iter = results_list.iterator(); + System.out.println("Size = " + results_list.size()); + while (iter.hasNext() == true) { str = ((GlobalString)(iter.next())).toLocalString(); System.printString(str + "\n"); diff --git a/Robust/src/Benchmarks/Recovery/bm_args.txt b/Robust/src/Benchmarks/Recovery/bm_args.txt index 36796d88..10959ef2 100644 --- a/Robust/src/Benchmarks/Recovery/bm_args.txt +++ b/Robust/src/Benchmarks/Recovery/bm_args.txt @@ -1 +1,4 @@ +MatrixMultiply:2000 80 +FileSystem:data Spider:"www.uci.edu" "" 5 +SpamFilter:-e 600 -n 600 diff --git a/Robust/src/Benchmarks/Recovery/runjava.sh b/Robust/src/Benchmarks/Recovery/runjava.sh index 7adb5eaa..4d59ef94 100755 --- a/Robust/src/Benchmarks/Recovery/runjava.sh +++ b/Robust/src/Benchmarks/Recovery/runjava.sh @@ -1,9 +1,23 @@ # !/bin/sh + +# Usage +# +# ./runjava.sh +# + BASEDIR=`pwd` RECOVERYDIR='recovery' JAVASINGLEDIR='java' -ITERATIONS=10 -WAITTIME=300 +ITERATIONS=1 +WAITTIME=30 + +# 0 mean new test +# 1~8 machine id to be killed +ORDER=( 0 1 3 5 7 8 2 + 0 1 2 3 4 5 6 + 0 1 8 4 6 3 7 + 0 8 7 3 6 5 4 + 0 7 4 6 8 1 2 ); # killClients <# of machines> function killclients { @@ -83,23 +97,34 @@ function runFailureTest { tt=1; while [ $tt -le $NUM_MACHINE ]; do - echo "------------------------------- Failure Test $1 ----------------------------" >> log-$tt tt=`expr $tt + 1` done - # run all machines - runMachines log - sleep 10 # wait until all machine run - # Kill machines - for k in 2 4 6 8 + test_iter=0; + + for k in ${ORDER[@]} do - echo "------------------------ dc-$k is killed ------------------------" >> log-$k - killonemachine $fileName $k - sleep 10 + if [ $k -eq 0 ]; then # if k = 0, it is a new test + if [ $test_iter -ne 1 ]; then + sleep $WAITTIME # wait the end of execution + killclients $fileName 8 # kill alive machines + else + test_iter=`expr $test_iter + 1` + fi + + echo "------------------------------- Failure Test $test_iter ----------------------------" >> log-$tt + runMachines log + sleep 10 # wait until all machine run + + else # if k != 0, time to kill machines! + echo "------------------------ dc-$k is killed ------------------------" >> log-$k + killonemachine $fileName $k + + let "killdelay= $RANDOM % 2 + 3" + sleep $killdelay + fi done - sleep $WAITTIME # wait the end of execution - killclients $fileName 8 # kill alive machines sleep 10 cd - } @@ -118,15 +143,14 @@ do echo "BM_ARGS='$BM_ARGS'" > ~/.bmargs fileName=${BM_NAME}.bin - echo "fileName='$fileName'" # terminate if it doesn't have parameter let "NUM_MACHINE= $1 + 0"; - if [ $NUM_MACHINE -eq 0 ]; + if [ $NUM_MACHINE -eq 0 ] then echo "Wrong input" - let "Num= 8"; + echo "Usage : ./runjava.sh " exit 0 fi @@ -134,23 +158,16 @@ do echo "BM_ARGS= $BM_ARGS" echo "NUM_M = $NUM_MACHINE" + echo "====================================== Normal Test ==============================" + runNormalTest $NUM_MACHINES 1 - echo "=================================== 1 =================================" - runNormalTest $NUM_MACHINES 1 - echo "=======================================================================" - - t=2; - while [ $t -le $ITERATIONS ]; do - echo "==================================== $t =============================" -# runFailureTest $NUM_MACHINES 1 -# sleep 10 - echo "=====================================================================" - t=`expr $t + 1` - done + echo "=================================================================================" + echo "====================================== Failure Test =============================" + runFailureTest $NUM_MACHINES + echo "=================================================================================" killclients $fileName 8 -done echo "----------- done ------------" -- 2.34.1