From ec9971bdb202f8559f6b6eb8fdd55598aeeecc06 Mon Sep 17 00:00:00 2001 From: adash Date: Thu, 6 Aug 2009 01:43:45 +0000 Subject: [PATCH] small changes --- .../SingleTM/MicroBenchmarks/README | 2 + .../MicroBenchmarks/SingleObjectMod.java | 38 +++++++++++++------ .../SingleTM/MicroBenchmarks/makefile | 2 +- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/README b/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/README index e2467520..33ed312c 100644 --- a/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/README +++ b/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/README @@ -18,6 +18,8 @@ SingleObjectMod.java: ./STATSSingleObjectMod.bin -t -size -l + -l1 + -l2 low contention: -t 8 -size 5000 -l 100 high contention: -t 8 -size 5 -l 500000 diff --git a/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/SingleObjectMod.java b/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/SingleObjectMod.java index 8658663f..7cac863a 100644 --- a/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/SingleObjectMod.java +++ b/Robust/src/Benchmarks/SingleTM/MicroBenchmarks/SingleObjectMod.java @@ -2,6 +2,7 @@ public class SingleObjectMod extends Thread { int nthreads; int arrysize; int loopsize; + int lsize1, lsize2; int threadid; intwrapper[] mainobj; Random rand; @@ -10,10 +11,12 @@ public class SingleObjectMod extends Thread { } - public SingleObjectMod(int nthreads, int arrysize, int loopsize, int threadid, intwrapper[] mainobj, Random rand) { + public SingleObjectMod(int nthreads, int arrysize, int loopsize, int lsize1, int lsize2, int threadid, intwrapper[] mainobj, Random rand) { this.nthreads = nthreads; this.arrysize = arrysize; this.loopsize = loopsize; + this.lsize1 = lsize1; + this.lsize2 = lsize2; this.threadid = threadid; this.mainobj = mainobj; this.rand = rand; @@ -37,9 +40,17 @@ public class SingleObjectMod extends Thread { if(i < args.length) { som.loopsize = new Integer(args[i++]).intValue(); } + } else if(arg.equals("-l1")) { + if(i < args.length) { + som.lsize1 = new Integer(args[i++]).intValue(); + } + } else if(arg.equals("-l2")) { + if(i < args.length) { + som.lsize2 = new Integer(args[i++]).intValue(); + } } else { System.out.println("Incorrect argument"); - System.out.println("usage: ./SingleObjectMod -t -size -l \n"); + System.out.println("usage: ./SingleObjectMod -t -size -l -l1 -l2 \n"); } } } @@ -56,18 +67,23 @@ public class SingleObjectMod extends Thread { stop = loopsize; else stop = start + partitionSize; - //System.out.println("Start = " + start+ " stop= " + stop + " partitionSize= " + partitionSize+ " nthreads= " + nthreads); + //System.out.println("Start = " + start+ " stop= " + stop + " partitionSize= " + partitionSize+ " loopsize= " + loopsize + " lsize1= " + lsize1 + " lsize2= " + lsize2); for(int i = start; i < stop; i++) { - // Only read values from an object + int count; atomic { index = (int)(rand.random_generate() % arrysize); + // Do computation 1 + for(int j = 0; j