From 9d29ced198db9dd3da1ef13e9e8d13095718b93f Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 6 Aug 2008 08:49:21 +0000 Subject: [PATCH] still have some compile errors . Use Em3d with new Barrier class --- .../Benchmarks/Prefetch/Em3d/dsm/Em3d2.java | 41 +++++++++++++------ .../src/Benchmarks/Prefetch/Em3d/dsm/makefile | 28 ++++++++----- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java index b3559bed..93776f2e 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java @@ -42,16 +42,17 @@ public class Em3d extends Thread { BiGraph bg; int upperlimit; int lowerlimit; - Barrier mybarr; + //Barrier barr; + String hostname; public Em3d() { } - public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, Barrier mybarr, int numDegree, int threadindex) { + public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, int numDegree, int threadindex, String name) { this.bg = bg; this.lowerlimit = lowerlimit; this.upperlimit = upperlimit; this.numIter = numIter; - this.mybarr = mybarr; + this.hostname = name; this.numDegree = numDegree; this.threadindex=threadindex; } @@ -62,9 +63,9 @@ public class Em3d extends Thread { int degree; Random random; + barr = new Barrier(hostname); atomic { iteration = numIter; - barr=mybarr; degree = numDegree; random = new Random(lowerlimit); } @@ -74,6 +75,7 @@ public class Em3d extends Thread { bg.allocateNodes ( lowerlimit, upperlimit, threadindex); } Barrier.enterBarrier(barr); + System.clearPrefetchCache(); atomic { //initialize the eNodes @@ -139,12 +141,21 @@ public class Em3d extends Thread { long start0 = System.currentTimeMillis(); int numThreads = em.numThreads; int[] mid = new int[4]; + String[] hostname; + atomic { + hostname = global new String[4]; + hostname[0] = global new String("128.195.175.79"); + hostname[1] = global new String("128.195.175.73"); + hostname[2] = global new String("128.195.175.78"); + hostname[3] = global new String("128.195.175.69"); + } mid[0] = (128<<24)|(195<<16)|(175<<8)|79;//dw-1 - mid[1] = (128<<24)|(195<<16)|(175<<8)|80;//dw-2 - mid[2] = (128<<24)|(195<<16)|(175<<8)|73; - mid[3] = (128<<24)|(195<<16)|(175<<8)|78; + mid[1] = (128<<24)|(195<<16)|(175<<8)|73;//dw-2 + mid[2] = (128<<24)|(195<<16)|(175<<8)|78; + mid[3] = (128<<24)|(195<<16)|(175<<8)|69; + System.printString("DEBUG -> numThreads = " + numThreads+"\n"); - Barrier mybarr; + BarrierServer mybarr; BiGraph graph; @@ -152,7 +163,7 @@ public class Em3d extends Thread { // System.printString( "Allocating BiGraph.\n" ); atomic { - mybarr = global new Barrier(numThreads); + mybarr = global new BarrierServer(numThreads); graph = BiGraph.create(em.numNodes, em.numDegree, numThreads); } @@ -168,21 +179,25 @@ public class Em3d extends Thread { for(int i=0;i