From 7e44bc7459b74e11d28f0121f2e9118653f02fba Mon Sep 17 00:00:00 2001 From: jihoonl Date: Tue, 10 Nov 2009 23:07:38 +0000 Subject: [PATCH] migrates recovery benchmarks --- .../Prefetch/MicroBenchmarks/Makefile | 110 +++++++----- .../Prefetch/MicroBenchmarks/dsm/Drinker.java | 120 ------------- .../Prefetch/MicroBenchmarks/dsm/Simple.java | 166 ------------------ .../Prefetch/MicroBenchmarks/dsm/dstm.conf | 10 -- .../Prefetch/MicroBenchmarks/dsm/makefile | 17 -- 5 files changed, 62 insertions(+), 361 deletions(-) delete mode 100644 Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Drinker.java delete mode 100644 Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Simple.java delete mode 100644 Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/dstm.conf delete mode 100644 Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/makefile diff --git a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/Makefile b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/Makefile index 88e32bc3..976bdc89 100644 --- a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/Makefile +++ b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/Makefile @@ -6,66 +6,80 @@ MAINCLASS3=ReadArrayObj NAME3=MultiMCReadcommit MAINCLASS4=WriteArrayObj NAME4=MultiMCWritecommit +MAINCLASS6=MoreSimple +NAME6=MoreSimple SRC1=${NAME1}.java \ ReadArrayWrap.java SRC2=${NAME2}.java \ WriteArrayWrap.java SRC3=${NAME3}.java \ - ReadArrayObjWrap.java \ - ../../../ClassLibrary/JavaDSM/Barrier.java + ReadArrayObjWrap.java SRC4=${NAME4}.java \ - WriteArrayObjWrap.java \ - ../../../ClassLibrary/JavaDSM/Barrier.java -FLAGS1 = -dsm -prefetch -dsmcaching -optimize -debug -mainclass ${MAINCLASS1} + WriteArrayObjWrap.java +SRC6=${NAME6}.java +FLAGS1 = -dsm -prefetch -dsmcaching -nooptimize -debug -mainclass ${MAINCLASS1} FLAGS2 = -dsm -dsmcaching -optimize -mainclass ${MAINCLASS1} -FLAGS3 = -dsm -prefetch -dsmcaching -optimize -debug -mainclass ${MAINCLASS2} +FLAGS3 = -dsm -prefetch -dsmcaching -nooptimize -debug -mainclass ${MAINCLASS2} FLAGS4 = -dsm -dsmcaching -optimize -mainclass ${MAINCLASS2} -FLAGS5 = -dsm -prefetch -dsmcaching -optimize -debug -mainclass ${MAINCLASS3} +FLAGS5 = -dsm -prefetch -dsmcaching -nooptimize -debug -mainclass ${MAINCLASS3} FLAGS6 = -dsm -dsmcaching -optimize -mainclass ${MAINCLASS3} -FLAGS7 = -dsm -prefetch -dsmcaching -optimize -mainclass ${MAINCLASS4} -FLAGS8 = -dsm -dsmcaching -optimize -mainclass ${MAINCLASS4} +FLAGS7 = -dsm -prefetch -dsmcaching -nooptimize -debug -mainclass ${MAINCLASS4} +FLAGS8 = -dsm -dsmcaching -nooptimize -debug -mainclass ${MAINCLASS4} +FLAGS9 = -dsm -nooptimize -debug -mainclass ${MAINCLASS4} +FLAGS10= -dsm -nooptimize -recovery -debug -mainclass ${MAINCLASS5} +FLAGS11= -dsm -runtimedebug -nooptimize -recovery -debug -mainclass ${MAINCLASS6} +FLAGS12= -nojava -dsm -runtimedebug -nooptimize -recovery -debug -mainclass ${MAINCLASS5} -simple: - ../../../buildscript -dsm -dsmcaching -optimize -mainclass Simple -o Simple Simple.java default: - ../../../buildscript ${FLAGS2} -o ${NAME1}NP ${SRC1} - cp ${NAME1}NP.bin ${NAME1}1NP.bin - cp ${NAME1}NP.bin ${NAME1}2NP.bin - cp ${NAME1}NP.bin ${NAME1}3NP.bin - cp ${NAME1}NP.bin ${NAME1}4NP.bin - cp ${NAME1}NP.bin ${NAME1}5NP.bin - cp ${NAME1}NP.bin ${NAME1}6NP.bin - cp ${NAME1}NP.bin ${NAME1}7NP.bin - cp ${NAME1}NP.bin ${NAME1}8NP.bin - ../../../buildscript ${FLAGS4} -o ${NAME2}NP ${SRC2} - cp ${NAME2}NP.bin ${NAME2}1NP.bin - cp ${NAME2}NP.bin ${NAME2}2NP.bin - cp ${NAME2}NP.bin ${NAME2}3NP.bin - cp ${NAME2}NP.bin ${NAME2}4NP.bin - cp ${NAME2}NP.bin ${NAME2}5NP.bin - cp ${NAME2}NP.bin ${NAME2}6NP.bin - cp ${NAME2}NP.bin ${NAME2}7NP.bin - cp ${NAME2}NP.bin ${NAME2}8NP.bin - ../../../buildscript ${FLAGS6} -o ${NAME3}NP ${SRC3} - cp ${NAME3}NP.bin ${NAME3}1NP.bin - cp ${NAME3}NP.bin ${NAME3}2NP.bin - cp ${NAME3}NP.bin ${NAME3}3NP.bin - cp ${NAME3}NP.bin ${NAME3}4NP.bin - cp ${NAME3}NP.bin ${NAME3}5NP.bin - cp ${NAME3}NP.bin ${NAME3}6NP.bin - cp ${NAME3}NP.bin ${NAME3}7NP.bin - cp ${NAME3}NP.bin ${NAME3}8NP.bin - ../../../buildscript ${FLAGS8} -o ${NAME4}NP ${SRC4} - cp ${NAME4}NP.bin ${NAME4}1NP.bin - cp ${NAME4}NP.bin ${NAME4}2NP.bin - cp ${NAME4}NP.bin ${NAME4}3NP.bin - cp ${NAME4}NP.bin ${NAME4}4NP.bin - cp ${NAME4}NP.bin ${NAME4}5NP.bin - cp ${NAME4}NP.bin ${NAME4}6NP.bin - cp ${NAME4}NP.bin ${NAME4}7NP.bin - cp ${NAME4}NP.bin ${NAME4}8NP.bin +# ../../../buildscript ${FLAGS2} -o ${NAME1}NP ${SRC1} +# cp ${NAME1}NP.bin ${NAME1}1NP.bin +# cp ${NAME1}NP.bin ${NAME1}2NP.bin +# cp ${NAME1}NP.bin ${NAME1}3NP.bin +# cp ${NAME1}NP.bin ${NAME1}4NP.bin +# cp ${NAME1}NP.bin ${NAME1}5NP.bin +# cp ${NAME1}NP.bin ${NAME1}6NP.bin +# cp ${NAME1}NP.bin ${NAME1}7NP.bin +# cp ${NAME1}NP.bin ${NAME1}8NP.bin +# ../../../buildscript ${FLAGS4} -o ${NAME2}NP ${SRC2} +# cp ${NAME2}NP.bin ${NAME2}1NP.bin +# cp ${NAME2}NP.bin ${NAME2}2NP.bin +# cp ${NAME2}NP.bin ${NAME2}3NP.bin +# cp ${NAME2}NP.bin ${NAME2}4NP.bin +# cp ${NAME2}NP.bin ${NAME2}5NP.bin +# cp ${NAME2}NP.bin ${NAME2}6NP.bin +# cp ${NAME2}NP.bin ${NAME2}7NP.bin +# cp ${NAME2}NP.bin ${NAME2}8NP.bin +# ../../../buildscript ${FLAGS6} -o ${NAME3}NP ${SRC3} +# cp ${NAME3}NP.bin ${NAME3}1NP.bin +# cp ${NAME3}NP.bin ${NAME3}2NP.bin +# cp ${NAME3}NP.bin ${NAME3}3NP.bin +# cp ${NAME3}NP.bin ${NAME3}4NP.bin +# cp ${NAME3}NP.bin ${NAME3}5NP.bin +# cp ${NAME3}NP.bin ${NAME3}6NP.bin +# cp ${NAME3}NP.bin ${NAME3}7NP.bin +# cp ${NAME3}NP.bin ${NAME3}8NP.bin +# cp ${NAME4}NP.bin ${NAME4}1NP.bin +# ../../../buildscript ${FLAGS9} -o ${NAME4}NPNC ${SRC4} +# cp ${NAME4}NP.bin ${NAME4}2NP.bin +# cp ${NAME4}NP.bin ${NAME4}3NP.bin +# cp ${NAME4}NP.bin ${NAME4}4NP.bin +# cp ${NAME4}NP.bin ${NAME4}5NP.bin +# cp ${NAME4}NP.bin ${NAME4}6NP.bin +# cp ${NAME4}NP.bin ${NAME4}7NP.bin +# cp ${NAME4}NP.bin ${NAME4}8NP.bin + ../../../buildscript ${FLAGS10} -o ${NAME5}NPNC ${SRC5} +# # ../../../buildscript ${FLAGS11} -o ${NAME6}NPNC ${SRC6} -clean: +nojava: + ../../../buildscript ${FLAGS12} -o ${NAME5}NPNC ${SRC5} + +test: + ../../../make + default + + + +clear: rm -rf tmpbuilddirectory rm *.bin diff --git a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Drinker.java b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Drinker.java deleted file mode 100644 index 0ef18601..00000000 --- a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Drinker.java +++ /dev/null @@ -1,120 +0,0 @@ -public class Drinker extends Task { - int ownTotal; - - public Drinker(int num_threads,Queue todo,Queue done) { - ownTotal = 0; - todoList = todo; - doneList = done; - } - - // fill up the Work Pool - public void fillTodoList(Queue todoList, int size) { - Segment seg; - int i; - - for(i = 0; i < size; i += 10) { - seg = global new Segment(10); - todoList.push(seg); - } - - System.out.println("TodoSIZE = " + todoList.size()); - } - - public Object grabTask() { - atomic { - if (todoList.size() != 0) { - return (Segment)todoList.pop(); - } - } - return null; - } - - public void execute() { - Segment s; - atomic { - s = (Segment)myWork; - ownTotal += s.x; - } - } - - public void done(Object work) { - doneList.push(work); - } - - public static void main(String[] args) { - int NUM_THREADS; - int i,j; - int size = Integer.parseInt(args[1]); - Work[] work; - Drinker[] drinkers; - Segment[] currentWorkList; - Queue todoList; - Queue doneList; - - if (args.length > 0) { - NUM_THREADS = Integer.parseInt(args[0]); - } - - int[] mid = new int[NUM_THREADS]; - mid[0] = (128<<24)|(195<<16)|(180<<8)|21; //dw-2 - mid[1] = (128<<24)|(195<<16)|(180<<8)|24; //dw-5 -/* mid[0] = (128<<24)|(195<<16)|(136<<8)|164; //dc3 - mid[1] = (128<<24)|(195<<16)|(136<<8)|165; //dc4 - mid[2] = (128<<24)|(195<<16)|(136<<8)|166; //dc5 - mid[3] = (128<<24)|(195<<16)|(136<<8)|167; //dc6 - mid[4] = (128<<24)|(195<<16)|(136<<8)|168; //dc7 - mid[5] = (128<<24)|(195<<16)|(136<<8)|169; //dc8*/ - - atomic { - drinkers = global new Drinker[NUM_THREADS]; - todoList = global new Queue(500); - doneList = global new Queue(500); - - work = global new Work[NUM_THREADS]; - currentWorkList = global new Segment[NUM_THREADS]; - - drinkers[0] = global new Drinker(NUM_THREADS,todoList,doneList); - drinkers[0].fillTodoList(todoList,size); - work[0] = global new Work(drinkers[0], NUM_THREADS, 0 , currentWorkList); - - for(i = 1; i < NUM_THREADS; i++) { - drinkers[i] = global new Drinker(NUM_THREADS,todoList,doneList); - work[i] = global new Work(drinkers[i], NUM_THREADS, i,currentWorkList); - } - } - - System.out.println("Finished initialization"); - Work tmp; - for (i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = work[i]; - } - Thread.myStart(tmp,mid[i]); - } - - System.out.println("Finished Starting Threads"); - for (i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = work[i]; - } - System.out.println("Thread id " + i + " is joining"); - tmp.join(); - } - - System.printString("Finished\n"); - } -} - -public class Segment { - int x; - - Segment (int x) { - this.x = x; - } - - public String toString() - { - return "lol"; - } -} - diff --git a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Simple.java b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Simple.java deleted file mode 100644 index 1e0d50e6..00000000 --- a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/Simple.java +++ /dev/null @@ -1,166 +0,0 @@ -public class Simple extends Thread { - Counting mycount; - int id; - public Simple(Counting mycount, int i) { - this.mycount = mycount; - this.id = i; - } - - public void run() { - - int threadid; - - atomic { - threadid = id; -// System.println("\n##threadid: " + threadid + "\n"); - } -// if(threadid == ((128<<24)|(195<<16)|(180<<8)|24)) - // System.exit(0); - - for(int i = 0; i < 1000; i++) { - atomic { -// System.println("##threadid: " + threadid); - mycount.increment(); - } - -// if(threadid == ((128<<24)|(195<<16)|(180<<8)|21)) { - for(int j =0;j< 4;j++) { - atomic { - // System.out.println("##Threadid " + j + " : " + getStatus(j)); - } - } - // } - } - - FileOutputStream output = new FileOutputStream("output"+threadid); - int cc; - - atomic { - cc = mycount.count; - } - - String outStr = "Count = " + cc + "\n"; - output.write(outStr.getBytes()); - System.out.println("\n\n\nFinished!!!!!!\n\n\n\n"); - output.close(); - - - } - - public static void main(String[] args) { - Simple[] s; - Counting c; - int numthreads = 3; - int[] mid = new int[numthreads]; - FileOutputStream out = new FileOutputStream("output"); - -/* mid[0] = (128<<24)|(195<<16)|(180<<8)|26; //dw-7 - mid[1] = (128<<24)|(195<<16)|(180<<8)|24; //dw-5 - mid[2] = (128<<24)|(195<<16)|(180<<8)|21; //dw-2 -*/ -// mid[1] = (128<<24)|(195<<16)|(180<<8)|22; //dw-3 - 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[2] = (128<<24)|(195<<16)|(136<<8)|164; //dc-3 - mid[2] = (128<<24)|(195<<16)|(136<<8)|164; //dc-3 - mid[2] = (128<<24)|(195<<16)|(136<<8)|164; //dc-3 - mid[2] = (128<<24)|(195<<16)|(136<<8)|164; //dc-3 - mid[2] = (128<<24)|(195<<16)|(136<<8)|164; //dc-3 -// mid[3] = (128<<24)|(195<<16)|(136<<8)|165; //dc-4 - - - atomic { - - c = global new Counting(); - s = global new Simple[numthreads]; - for(int i = 0; i < numthreads; i++) { - s[i] = global new Simple(c, mid[i]); - } - - } - - ccc od = new ccc(); - ddd ad = new ddd(); - od.increment(); - - od.increment(3); - - od = (ccc)ad; - - od.increment(5); - - - - - System.out.println("##Done creating objects"); - Simple tmp; - for(int i = 0; i < numthreads; i++) { - atomic { - tmp = s[i]; - } - System.out.println("##Temp gets simple object; start temp simple object"); -// tmp.start(mid[i]); - Thread.myStart(tmp,mid[i]); - } - - System.out.println("\n\n##DONE starting Threads\n"); - - for(int i = 0; i < numthreads; i++) { - atomic { - tmp = s[i]; - } - System.out.println("##Wait\n"); - tmp.join(); - } - //print count - int finalcount; - atomic { - finalcount = c.count; - } - - String outStr = "Count = " + finalcount + "\n"; - out.write(outStr.getBytes()); - System.printString("Count = "+finalcount+"\n"); - out.close(); - - } - -} - -class Counting { - global int count; - public Counting() { - this.count = 0; - } - - public increment() { - count = count + 1; - } -} - -class ccc { - int dd; - public ccc() { - this.dd = 0; - } - - public increment() { - dd++; - } - - public increment(int o) { - dd += o; - } -} - -class ddd extends ccc { - - public ddd() { - this.dd = 0; - } - public increment(int u) - { - dd = u; - } -} diff --git a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/dstm.conf b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/dstm.conf deleted file mode 100644 index afab605b..00000000 --- a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/dstm.conf +++ /dev/null @@ -1,10 +0,0 @@ -128.195.180.21 -128.195.180.24 -#128.195.136.162 -#128.195.136.163 -#128.195.136.164 -#128.195.136.165 -#128.195.136.166 -#128.195.136.167 -#128.195.136.168 -#128.195.136.169 diff --git a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/makefile b/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/makefile deleted file mode 100644 index 16acd250..00000000 --- a/Robust/src/Benchmarks/Prefetch/MicroBenchmarks/dsm/makefile +++ /dev/null @@ -1,17 +0,0 @@ -MAINCLASS1=Drinker -MAINCLASS2=Simple -SRC1=${MAINCLASS1}.java -SRC2=${MAINCLASS2}.java -FLAGS1= -dsm -nooptimize -debug -recovery -mainclass ${MAINCLASS1} -FLAGS2= -dsm -nooptimize -debug -recovery -mainclass ${MAINCLASS2} -default: - ../../../../buildscript ${FLAGS1} -o ${MAINCLASS1} ${SRC1} - ../../../../buildscript ${FLAGS2} -o ${MAINCLASS2} ${SRC2} -drinker: - ../../../../buildscript ${FLAGS1} -o ${MAINCLASS1} ${SRC1} -simple: - ../../../../buildscript ${FLAGS2} -o ${MAINCLASS2} ${SRC2} - -clean: - rm -rf tmpbuilddirectory - rm *.bin -- 2.34.1