From: adash Date: Wed, 16 Apr 2008 01:26:40 +0000 (+0000) Subject: Clean up code X-Git-Tag: preEdgeChange~153 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=10d8a002da4db0c85c53c1bfb202daedff01cc1d;p=IRC.git Clean up code --- diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java index 2e2f363d..a5775672 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d.java @@ -65,6 +65,8 @@ public class Em3d extends Thread iteration = numIter; } + System.clearPrefetchCache(); + for (int i = 0; i < iteration; i++) { /* for eNodes */ atomic { @@ -116,20 +118,6 @@ public class Em3d extends Thread { Em3d em = new Em3d(); Em3d.parseCmdLine(args, em); - /* - atomic { - em = global new Em3d(); - Em3d.parseCmdLine(args, em); - } - - boolean printMsgs, printResult; - int numIter; - atomic { - printMsgs = em.printMsgs; - numIter = em.numIter; - printResult = em.printResult; - } - */ if (em.printMsgs) System.printString("Initializing em3d random graph..."); long start0 = System.currentTimeMillis(); @@ -140,14 +128,8 @@ public class Em3d extends Thread mybarr = global new Barrier(numThreads); } BiGraph graph; - BiGraph graph1; Random rand = new Random(783); - // atomic { - //rand = global new Random(783); - //} atomic { - //graph1 = global new BiGraph(); - graph = global new BiGraph(); graph = BiGraph.create(em.numNodes, em.numDegree, em.printResult, rand); } @@ -165,8 +147,6 @@ public class Em3d extends Thread atomic { em3d[0] = global new Em3d(graph, 1, em.numNodes, em.numIter, mybarr); - //em3d[0] = global new Em3d(graph, 1, em.numNodes/2, em.numIter, mybarr); - //em3d[1] = global new Em3d(graph, (em.numNodes/2)+1, em.numNodes, em.numIter, mybarr); } int mid = (128<<24)|(195<<16)|(175<<8)|73; @@ -188,33 +168,13 @@ public class Em3d extends Thread // print current field values if (em.printResult) { - // System.printString(graph.eNodes); StringBuffer retval = new StringBuffer(); - double newtmp; + double dvalue;; atomic { - newtmp = graph.eNodes.value; + dvalue = graph.eNodes.value; } - int xtmp = (int)newtmp; - System.printString("Value = " +xtmp); - /* - while(newtmp!=null) { - Node n = newtmp; - retval.append("E: " + n + "\n"); - // newtmp = newtmp.next; - } - */ - /* - atomic { - newtmp = graph.hNodes; - } - while(newtmp!=null) { - Node n = newtmp; - retval.append("H: " + n + "\n"); - newtmp = newtmp.next; - } - - System.printString(retval.toString()); - */ + int intvalue = (int)dvalue; + System.printString("Value = " + intvalue + "\n"); } if (em.printMsgs) { @@ -242,31 +202,20 @@ public class Em3d extends Thread // check for options that require arguments if (arg.equals("-n")) { if (i < args.length) { - // atomic { em.numNodes = new Integer(args[i++]).intValue(); - // } } } else if (arg.equals("-d")) { if (i < args.length) { - //atomic { em.numDegree = new Integer(args[i++]).intValue(); - //} } } else if (arg.equals("-i")) { if (i < args.length) { - //atomic { - //em.numIter = global new Integer(args[i++]).intValue(); em.numIter = new Integer(args[i++]).intValue(); - //} } } else if (arg.equals("-p")) { - //atomic { em.printResult = true; - //} } else if (arg.equals("-m")) { - //atomic { em.printMsgs = true; - //} } else if (arg.equals("-h")) { em.usage(); } diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Node.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Node.java index c3467a38..15f95368 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Node.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Node.java @@ -45,7 +45,6 @@ public class Node { { value = r.nextDouble(); // create empty array for holding toNodes - toNodes = global new Node[degree]; } @@ -136,20 +135,6 @@ public class Node { } } - /** - * Get the new value of the current node based on its neighboring - * from_nodes and coefficients. - **/ - - /* - public void computeNewValue() - { - for (int i = 0; i < fromCount; i++) { - value -= coeffs[i] * fromNodes[i].value; - } - } - */ - /** * Override the toString method to return the value of the node. * @return the value of the node. @@ -158,7 +143,6 @@ public class Node { { String returnString; returnString = "value " + (long)value + ", from_count " + fromCount; - //return "value " + value + ", from_count " + fromCount; } } diff --git a/Robust/src/ClassLibrary/System.java b/Robust/src/ClassLibrary/System.java index 2595e546..124f3174 100644 --- a/Robust/src/ClassLibrary/System.java +++ b/Robust/src/ClassLibrary/System.java @@ -13,4 +13,6 @@ public class System { } public static native void exit(int status); + + public static native void clearPrefetchCache(); }