From 0be77234318b9f72e64c6b3060a2470ebae73e34 Mon Sep 17 00:00:00 2001 From: jjenista Date: Wed, 6 Apr 2011 19:39:10 +0000 Subject: [PATCH] alter benchmark to run once, not up to seven times --- .../SerialDelaunayRefinement.java | 47 +++---------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/Robust/src/Benchmarks/oooJava/DelaunayRefinement-orig-algo/SerialDelaunayRefinement.java b/Robust/src/Benchmarks/oooJava/DelaunayRefinement-orig-algo/SerialDelaunayRefinement.java index e74aa90a..c50b0c5c 100644 --- a/Robust/src/Benchmarks/oooJava/DelaunayRefinement-orig-algo/SerialDelaunayRefinement.java +++ b/Robust/src/Benchmarks/oooJava/DelaunayRefinement-orig-algo/SerialDelaunayRefinement.java @@ -39,13 +39,15 @@ public class SerialDelaunayRefinement { //Numbers below are Long.Max_Value long lasttime = 0x7fffffffffffffffL; long mintime = 0x7fffffffffffffffL; - for (long run = 0; ((run < 3) || Math.abs(lasttime - runtime) * 64 > Math.min(lasttime, runtime)) && run < 7; run++) { + for (long run = 0; // jjenista - ONLY RUN ONCE! + run < 1; //((run < 3) || Math.abs(lasttime - runtime) * 64 > Math.min(lasttime, runtime)) && run < 7; + run++) { runtime = run(args); if (runtime < mintime) { mintime = runtime; } //System.exit( 0 ); // GC STALLS FOREVER???? - System.gc(); + //System.gc(); } System.out.println("minimum runtime: " + mintime + " ms"); @@ -78,9 +80,7 @@ public class SerialDelaunayRefinement { //treat LinkedList as a stack Stack worklist = new Stack(); - // LinkedList worklist = new LinkedList(); - // worklist.addAll(Mesh.getBad(mesh)); HashMapIterator it = m.getBad(mesh).iterator(); while (it.hasNext()) { worklist.push(it.next()); @@ -95,62 +95,35 @@ public class SerialDelaunayRefinement { System.gc(); - // int zzz = 0; - - -// long id = Time.getNewTimeId(); long startTime = System.currentTimeMillis(); while (!worklist.isEmpty()) { Node bad_element = (Node) worklist.pop(); -// System.out.println("Bad Node"+ ((Element)mesh.getNodeData(bad_element)).toString()); + if (bad_element != null && mesh.containsNode(bad_element)) { cavity.initialize(bad_element); cavity.build(); cavity.update(); - - - // boolean printChange = true; //(zzz % 10 == 0); //remove old data -// if( printChange ) { -// System.out.println( "\n\n\nbad tri: "+mesh.getNodeData( bad_element ) ); - // System.out.println( "\npre nodes: " ); - //} Node node; for (Iterator iterator = cavity.getPre().getNodes().iterator(); iterator.hasNext();) { node = (Node) iterator.next(); - //if( printChange ) { - // System.out.println( " "+mesh.getNodeData( node ) ); - //} mesh.removeNode(node); } //add new data - //if( printChange ) { - // System.out.println( "post nodes: " ); - //} for (Iterator iterator1 = cavity.getPost().getNodes().iterator(); iterator1.hasNext();) { node = (Node) iterator1.next(); - //if( printChange ) { - // System.out.println( " "+mesh.getNodeData( node ) ); - //} mesh.addNode(node); } - //if( printChange ) { - // System.out.println( "post edges: " ); - //} Edge_d edge; for (Iterator iterator2 = cavity.getPost().getEdges().iterator(); iterator2.hasNext();) { edge = (Edge_d) iterator2.next(); - //if( printChange ) { - // System.out.println( " "+mesh.getEdgeData( edge ) ); - //} mesh.addEdge(edge); } - // worklist.addAll(cavity.getPost().newBad(mesh)); it = cavity.getPost().newBad(mesh).iterator(); while (it.hasNext()) { worklist.push((Node)it.next()); @@ -159,14 +132,7 @@ public class SerialDelaunayRefinement { if (mesh.containsNode(bad_element)) { worklist.push((Node) bad_element); } - }// else { - //System.out.println( "\n\n\nthis tri no longer a concern: "+mesh.getNodeData( bad_element ) ); - //} - - //++zzz; - //System.out.println( "\n\ntris="+mesh.getNumNodes()+ - // " [wl="+worklist.size()+"]"); - //if( zzz == 10 ) { System.exit( 0 ); } + } } long time = System.currentTimeMillis() - startTime; System.out.println("runtime: " + time + " ms"); @@ -182,7 +148,6 @@ public class SerialDelaunayRefinement { //Put in cuz of static issues. Mesh m = new Mesh(); if (!m.verify(result)) { -// throw new IllegalStateException("refinement failed."); System.out.println("Refinement Failed."); System.exit(-1); } -- 2.34.1