From f6546e6d8b39714527624d5935d6c8a94360fb27 Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 18 May 2011 23:41:20 +0000 Subject: [PATCH] changes --- .../FileSystem/recovery/FileSystem.java | 45 ++++++++++--- .../Recovery/Game/recovery/Barrier.java | 18 ++--- .../Recovery/Game/recovery/RainForest.java | 44 ++++++++++--- .../recovery/MatrixMultiply.java | 65 ++++++++++--------- .../SpamFilter/recovery/SpamFilter.java | 52 ++++++++++----- .../Recovery/Spider/recovery/QueryTask.java | 1 + .../Recovery/Spider/recovery/README | 13 ++++ .../Recovery/Spider/recovery/Spider.java | 45 ++++++++++--- Robust/src/Benchmarks/Recovery/bm_args.txt | 4 +- .../Benchmarks/Recovery/bm_args_16threads.txt | 5 ++ Robust/src/Benchmarks/Recovery/runjava.sh | 46 +++++++------ 11 files changed, 236 insertions(+), 102 deletions(-) create mode 100644 Robust/src/Benchmarks/Recovery/Spider/recovery/README create mode 100644 Robust/src/Benchmarks/Recovery/bm_args_16threads.txt diff --git a/Robust/src/Benchmarks/Recovery/FileSystem/recovery/FileSystem.java b/Robust/src/Benchmarks/Recovery/FileSystem/recovery/FileSystem.java index c17140e8..450796f8 100644 --- a/Robust/src/Benchmarks/Recovery/FileSystem/recovery/FileSystem.java +++ b/Robust/src/Benchmarks/Recovery/FileSystem/recovery/FileSystem.java @@ -79,15 +79,42 @@ public class FileSystem extends Thread { System.exit(0); } - int[] mid = new int[8]; - mid[0] = (128<<24)|(195<<16)|(136<<8)|162;//dc-1 - mid[1] = (128<<24)|(195<<16)|(136<<8)|163;//dc-2 - mid[2] = (128<<24)|(195<<16)|(136<<8)|164;//dc-3 - mid[3] = (128<<24)|(195<<16)|(136<<8)|165;//dc-4 - mid[4] = (128<<24)|(195<<16)|(136<<8)|166;//dc-5 - mid[5] = (128<<24)|(195<<16)|(136<<8)|167;//dc-6 - mid[6] = (128<<24)|(195<<16)|(136<<8)|168;//dc-7 - mid[7] = (128<<24)|(195<<16)|(136<<8)|169;//dc-8 + int[] mid = null; + + if(NUM_THREADS <= 8 ) { + mid = new int[8]; + 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 + mid[3] = (128<<24)|(195<<16)|(136<<8)|165; //dc4 + mid[4] = (128<<24)|(195<<16)|(136<<8)|166; //dc5 + 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 + } else { + mid = new int[16]; + mid[0] = (128<<24)|(195<<16)|(136<<8)|162; //dc1 + mid[1] = (128<<24)|(195<<16)|(136<<8)|162; //dc1 + mid[2] = (128<<24)|(195<<16)|(136<<8)|163; //dc2 + mid[3] = (128<<24)|(195<<16)|(136<<8)|163; //dc2 + mid[4] = (128<<24)|(195<<16)|(136<<8)|164; //dc3 + mid[5] = (128<<24)|(195<<16)|(136<<8)|164; //dc3 + mid[6] = (128<<24)|(195<<16)|(136<<8)|165; //dc4 + mid[7] = (128<<24)|(195<<16)|(136<<8)|165; //dc4 + mid[8] = (128<<24)|(195<<16)|(136<<8)|166; //dc5 + mid[9] = (128<<24)|(195<<16)|(136<<8)|166; //dc5 + mid[10] = (128<<24)|(195<<16)|(136<<8)|167; //dc6 + mid[11] = (128<<24)|(195<<16)|(136<<8)|167; //dc6 + mid[12] = (128<<24)|(195<<16)|(136<<8)|168; //dc7 + mid[13] = (128<<24)|(195<<16)|(136<<8)|168; //dc7 + mid[14] = (128<<24)|(195<<16)|(136<<8)|169; //dc8 + mid[15] = (128<<24)|(195<<16)|(136<<8)|169; //dc8 + } + + if(mid == null) { + System.out.println("Number of machines not initialized"); + System.exit(1); + } FileSystem[] lus; atomic { diff --git a/Robust/src/Benchmarks/Recovery/Game/recovery/Barrier.java b/Robust/src/Benchmarks/Recovery/Game/recovery/Barrier.java index 9ab76b93..f8cf00a3 100644 --- a/Robust/src/Benchmarks/Recovery/Game/recovery/Barrier.java +++ b/Robust/src/Benchmarks/Recovery/Game/recovery/Barrier.java @@ -6,13 +6,13 @@ public class Barrier extends Thread { int rows; int cols; - public Barrier(int n, threadinfo[] tinfo, GameMap[][] land, int maxage, int rows, int cols) { - this.land=land; - this.maxage=maxage; - this.rows=rows; - this.cols=cols; - this.numthreads=n; - this.tinfo=tinfo; + public Barrier(int tn, threadinfo[] ttinfo, GameMap[][] tland, int tmaxage, int trows, int tcols) { + land=tland; + maxage=tmaxage; + rows=trows; + cols=tcols; + numthreads=tn; + tinfo=ttinfo; /* this.tinfo=global new threadinfo[n]; for(int i=0; i> log-$tt @@ -144,9 +150,9 @@ function runSequentialFailureTest { outputIter=0; for outputIter in 1 2 3 4 5 6 7 8 do - echo "------------------------------- Failure Test $test_iter ----------------------------" >> log-$outputIter + echo "------------------------------- Sequential Failure Test $test_iter ----------------------------" >> log-$outputIter done - echo "------------------------------- Failure Test $test_iter ----------------------------" + echo "------------------------------- Sequential Failure Test $test_iter ----------------------------" runMachines log sleep 10 # wait until all machine run test_iter=`expr $test_iter + 1` @@ -155,7 +161,7 @@ function runSequentialFailureTest { echo "------------------------ dc-$k is killed ------------------------" killonemachine $fName $k - let "delay= $RANDOM % $KILLDELAY + 15" + let "delay= $RANDOM % $KILLDELAY + 8" sleep $delay fi done @@ -175,9 +181,8 @@ function runSingleFailureTest { test_iter=1; -#ORDER=( 0 1 8 4 6 3 7 ); -#SINGLE_ORDER=( 1 8 4 6 3 2 7 5 ); - SINGLE_ORDER=( 8 ); +SINGLE_ORDER=( 1 8 4 6 3 2 7 5 ); +#SINGLE_ORDER=( 8 ); for machinename in ${SINGLE_ORDER[@]} @@ -185,9 +190,9 @@ function runSingleFailureTest { outputIter=0; for outputIter in 1 2 3 4 5 6 7 8 do - echo "------------------------------- Failure Test $test_iter ----------------------------" >> log-$outputIter + echo "------------------------------- Single Failure Test $test_iter ----------------------------" >> log-$outputIter done - echo "------------------------------- Failure Test $test_iter ----------------------------" + echo "------------------------------- Single Failure Test $test_iter ----------------------------" runMachines log sleep 10 # wait until all machine run test_iter=`expr $test_iter + 1` @@ -343,18 +348,19 @@ function testcase { # terminate if it doesn't have parameter let "NUM_MACHINE= $nummachines + 0"; -# echo "====================================== Normal Test ==============================" -# runNormalTest $NUM_MACHINES 1 -# echo "================================================================================" - - echo "====================================== Failure Test =============================" - runSequentialFailureTest $NUM_MACHINES - echo "=================================================================================" + echo "====================================== Normal Test ==============================" + runNormalTest $NUM_MACHINES 1 + echo "================================================================================" # echo "====================================== Single Failure Test =============================" # runSingleFailureTest $NUM_MACHINES # echo "=================================================================================" +# echo "====================================== Sequential Failure Test =============================" +# runSequentialFailureTest $NUM_MACHINES +# echo "=================================================================================" + + # echo "=============== Running javasingle for ${BM_NAME} on 1 machines =================" # javasingle 1 ${BM_NAME} # cd $TOPDIR @@ -447,6 +453,6 @@ function dsmsingle { echo "---------- Starting Benchmarks ----------" nmach=$1 -source bm_args.txt -#source bm_args_16threads.txt +#source bm_args.txt +source bm_args_16threads.txt echo "----------- done ------------" -- 2.34.1