From f8b7f8035d61be1460f43375bd936c4d638ddeac Mon Sep 17 00:00:00 2001 From: adash Date: Mon, 14 Apr 2008 17:57:14 +0000 Subject: [PATCH] compile error fixes --- .../Benchmarks/Prefetch/Em3d/dsm/Barrier.java | 6 +- .../Benchmarks/Prefetch/Em3d/dsm/BiGraph.java | 10 +-- .../Benchmarks/Prefetch/Em3d/dsm/Em3d.java | 14 +++-- .../Benchmarks/Prefetch/Em3d/dsm/Node.java | 61 +++---------------- .../Prefetch/Em3d/java/Barrier.java | 2 - 5 files changed, 25 insertions(+), 68 deletions(-) diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Barrier.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Barrier.java index 2f0f05dd..482b695a 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Barrier.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Barrier.java @@ -21,16 +21,14 @@ public class Barrier { int tmp; boolean retry=true; - if(b.numthreads == 1) - return; - do { atomic { if (!b.cleared) { b.entercount++; tmp = b.entercount; if (tmp==b.numthreads) { - b.cleared=true; + if(b.numthreads > 1) + b.cleared=true; b.entercount--; return; } diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraph.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraph.java index f952f7e2..40ef2515 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraph.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraph.java @@ -38,12 +38,14 @@ public class BiGraph BiGraph create(int numNodes, int numDegree, boolean verbose, Random r) { - Node newnode = new Node(); + Node newnode = global new Node(); // making nodes (we create a table) //if (verbose) System.printString("making nodes (tables in orig. version)"); - Node[] hTable = newnode.fillTable(numNodes, numDegree, r); - Node[] eTable = newnode.fillTable(numNodes, numDegree, r); + Node[] hTable = global new Node[numNodes]; + Node[] eTable = global new Node[numNodes]; + hTable = newnode.fillTable(numNodes, numDegree, r); + eTable = newnode.fillTable(numNodes, numDegree, r); // making neighbors //if (verbose) System.printString("updating from and coeffs"); @@ -79,7 +81,7 @@ public class BiGraph n.updateFromNodes(r); } - BiGraph g = new BiGraph(eTable[0], hTable[0]); + BiGraph g = global new BiGraph(eTable[0], hTable[0]); return g; } diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java index 28ffe641..33e72ff4 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java @@ -40,7 +40,6 @@ public class Em3d extends Thread BiGraph bg; int upperlimit; int lowerlimit; - //Random rand; Barrier mybarr; public Em3d() { @@ -61,15 +60,18 @@ public class Em3d extends Thread public void run() { int iteration; + int b; + atomic { iteration = numIter; + b = mybarr.numthreads; } for (int i = 0; i < iteration; i++) { Barrier runBarrier = new Barrier(); /* for eNodes */ - Node prev, curr; atomic { + Node prev, curr; prev = bg.eNodes; curr = null; for(int j = 0; j