From 53af1af6046cfc7754b4e1224c94087f349ee488 Mon Sep 17 00:00:00 2001 From: yeom Date: Fri, 2 Apr 2010 00:37:37 +0000 Subject: [PATCH] bug fixes for generating empty graph. --- Robust/src/Analysis/MLP/ConflictGraph.java | 33 ++++++++-------------- Robust/src/IR/Flat/BuildCode.java | 8 ++++-- 2 files changed, 16 insertions(+), 25 deletions(-) diff --git a/Robust/src/Analysis/MLP/ConflictGraph.java b/Robust/src/Analysis/MLP/ConflictGraph.java index a7c4c72b..2520b841 100644 --- a/Robust/src/Analysis/MLP/ConflictGraph.java +++ b/Robust/src/Analysis/MLP/ConflictGraph.java @@ -23,29 +23,18 @@ public class ConflictGraph { public ConflictGraph() { id2cn = new Hashtable(); } - - private boolean isReadOnly(ConflictNode node) { - - if (node instanceof StallSiteNode) { - StallSiteNode stallSiteNode = (StallSiteNode) node; - HashSet effectSet = stallSiteNode.getStallSite() - .getEffectSet(); - for (Iterator iterator = effectSet.iterator(); iterator.hasNext();) { - Effect effect = (Effect) iterator.next(); - if (effect.getEffectType().equals(StallSite.WRITE_EFFECT)) { - return false; - } - } - } else { - LiveInNode liveInNode = (LiveInNode) node; - Set writeEffectSet = liveInNode - .getWriteEffectsSet(); - if (writeEffectSet != null && writeEffectSet.size() > 0) { - return false; + + public boolean hasConflictEdge(){ + + Set keySet=id2cn.keySet(); + for (Iterator iterator = keySet.iterator(); iterator.hasNext();) { + String key = (String) iterator.next(); + ConflictNode node=id2cn.get(key); + if(node.getEdgeSet().size()>0){ + return true; } - } - - return true; + } + return false; } public void analyzeConflicts() { diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 2ec13056..8832a0bc 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -1778,12 +1778,13 @@ public class BuildCode { // eom ConflictGraph graph = null; graph = mlpa.getConflictGraphResults().get(fm); - if (graph != null) { + if (graph != null && graph.hasConflictEdge()) { output.println(" /* set up waiting queues */"); output.println(" int numMemoryQueue=0;"); output.println(" int memoryQueueItemID=0;"); HashSet lockSet = mlpa.getConflictGraphLockMap().get( graph); + System.out.println("#lockSet="+lockSet.hashCode()); System.out.println("lockset="+lockSet); for (Iterator iterator = lockSet.iterator(); iterator.hasNext();) { SESELock seseLock = (SESELock) iterator.next(); @@ -2084,12 +2085,13 @@ public class BuildCode { output.println(" int memoryQueueItemID=0;"); ConflictGraph graph = null; graph = mlpa.getConflictGraphResults().get(fsen); - if (graph != null) { + if (graph != null && graph.hasConflictEdge()) { output.println(" {"); output .println(" SESEcommon* parentCommon = &(___params___->common);"); HashSet lockSet = mlpa.getConflictGraphLockMap().get( graph); + System.out.println("#lockSet="+lockSet); if (lockSet.size() > 0) { output.println(" numMemoryQueue=" + lockSet.size() + ";"); @@ -3369,7 +3371,7 @@ public class BuildCode { graph = mlpa.getConflictGraphResults().get(parent); } } - if (graph != null) { + if (graph != null && graph.hasConflictEdge()) { HashSet seseLockSet = mlpa.getConflictGraphLockMap().get( graph); output.println(); -- 2.34.1