From c39c1336e4f90bcb2f166fb5b7be35c7701a64c4 Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 14 Apr 2010 18:22:48 +0000 Subject: [PATCH] comment debugs, add code for timing thr execution, machine id changes in main() --- .../recovery/MatrixMultiply.java | 21 +++++++------------ .../MatrixMultiply/recovery/Worker.java | 11 ++++------ .../Recovery/MatrixMultiply/recovery/makefile | 10 ++++++--- 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java index e8420430..25c8d328 100644 --- a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java +++ b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/MatrixMultiply.java @@ -101,28 +101,21 @@ 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)|24; //dw-5 -*/ - -// mid[0] = (128<<24)|(195<<16)|(180<<8)|20; //dw-1 -/* mid[0] = (128<<24)|(195<<16)|(136<<8)|162; //dc1 + 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[0] = (128<<24)|(195<<16)|(136<<8)|166; //dc5 - mid[1] = (128<<24)|(195<<16)|(136<<8)|167; //dc6 - mid[2] = (128<<24)|(195<<16)|(136<<8)|168; //dc7 - mid[3] = (128<<24)|(195<<16)|(136<<8)|169; //dc8 + 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 atomic { ts = global new TaskSet(NUM_THREADS); for( i = 0; i< NUM_THREADS; i++) { - ts.threads[i] = global new Worker(ts,i); + ts.threads[i] = global new Worker(ts); } } diff --git a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/Worker.java b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/Worker.java index 954ac6d0..36e249cc 100644 --- a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/Worker.java +++ b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/Worker.java @@ -1,16 +1,14 @@ public class Worker extends Thread { - Object[] currentWorkList; - int mid; TaskSet tasks; Task workingtask; - Worker(TaskSet tasks, int mid) { + Worker(TaskSet tasks) { this.tasks = tasks; - this.currentWorkList = currentWorkList; - mid = mid; } public void run() { + long st = System.currentTimeMillis(); + long fi = 0; boolean notdone=true; while(notdone) { @@ -55,8 +53,7 @@ public class Worker extends Thread { sleep(500000); } } - - System.out.println("done"); + System.out.println("\n\nDone - Time Elapse : " + (double)((fi-st)/1000) +"\n\n"); } public static native void printRecoveryStat(); } diff --git a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/makefile b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/makefile index 07e173be..f88ee890 100644 --- a/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/makefile +++ b/Robust/src/Benchmarks/Recovery/MatrixMultiply/recovery/makefile @@ -1,14 +1,18 @@ MAINCLASS=MatrixMultiply SRC1=${MAINCLASS}.java \ + GlobalQueue.java \ + TaskSet.java \ + Task.java \ + Worker.java -FLAGS=-recovery -recoverystats -dsm -dsmtask -transstats -prefetch -dsmcaching -32bit -optimize -mainclass ${MAINCLASS} -excprefetch Task.isTodoListEmpty -excprefetch MatrixMultiply.output -excprefetch GlobalQueue.push -excprefetch MatrixMultiply.fillTodoList -excprefetch GlobalQueue.pop -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -excprefetch Work.checkCurrentWorkList -excprefetch MMul.getSum -excprefetch Task.grabTask +FLAGS=-recovery -recoverystats -dsm -dsmtask -transstats -prefetch -dsmcaching -32bit -optimize -mainclass ${MAINCLASS} -excprefetch Task.isTodoListEmpty -excprefetch MatrixMultiply.output -excprefetch GlobalQueue.push -excprefetch MatrixMultiply.fillTodoList -excprefetch GlobalQueue.pop -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -excprefetch Work.checkCurrentWorkList -excprefetch MMul.getSum -excprefetch Task.grabTask -excprefetch Worker.Worker -excprefetch Task.dequeueTask -trueprob 0.96 DSMFLAGS= -dsm -dsmtask -transstats -prefetch -dsmcaching -32bit -optimize -mainclass ${MAINCLASS} -excprefetch Task.isTodoListEmpty -excprefetch MatrixMultiply.output -excprefetch GlobalQueue.push -excprefetch MatrixMultiply.fillTodoList -excprefetch GlobalQueue.pop -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -excprefetch Work.checkCurrentWorkList -excprefetch MMul.getSum -excprefetch Task.grabTask RECOVERYFLAGS=-recovery -dsm -dsmtask -nooptimize -debug -mainclass ${MAINCLASS} default: -# ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC1} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC1} # ../../../../buildscript ${DSMFLAGS} -o ${MAINCLASS}DSM ${SRC1} - ../../../../buildscript ${RECOVERYFLAGS} -o ${MAINCLASS} ${SRC1} +# ../../../../buildscript ${RECOVERYFLAGS} -o ${MAINCLASS} ${SRC1} clean: rm -rf tmpbuilddirectory -- 2.34.1