bug fix.
authoryeom <yeom>
Thu, 7 Jan 2010 18:53:57 +0000 (18:53 +0000)
committeryeom <yeom>
Thu, 7 Jan 2010 18:53:57 +0000 (18:53 +0000)
examine all elements in the waiting queue to allow more parallel execution.

Robust/src/Analysis/MLP/ConflictGraph.java
Robust/src/IR/Flat/BuildCode.java

index 508dbfe4fe9db0850dff11170b8e06f0037b82c8..512732a1afd71cc606e85a67239ed02ea709408b 100644 (file)
@@ -133,6 +133,26 @@ public class ConflictGraph {
                                }
 
                        }
+                       
+                       // for another case where only reading regions are overlapped
+                       readIter = readEffectsSet.iterator();
+                       while (readIter.hasNext()) {
+                               
+                               SESEEffectsKey seseEffectsKey = (SESEEffectsKey) readIter
+                               .next();
+                               String readHeapRegionID = seseEffectsKey.getHRNUniqueId();
+                               
+                               HashSet<HeapRegionNode> stallSiteHRNSet = nodeA.getHRNSet();
+                               for (Iterator iterator = stallSiteHRNSet.iterator(); iterator
+                                               .hasNext();) {
+                                       HeapRegionNode stallHRN = (HeapRegionNode) iterator.next();
+                                       if (stallHRN.getGloballyUniqueIdentifier().equals(
+                                                       readHeapRegionID)) {
+                                               result = result | true;
+                                       }
+                               }
+                       }
+                       
                }
 
                return result;
index 8c94b32a15c02c839ebcd0378f796ae0fbd44287..df5f82f54eca29dcff350dcb6503a3728d70aa87 100644 (file)
@@ -3383,20 +3383,17 @@ public class BuildCode {
                        if (allocSet.size() > 0) {
                                output.println("     {");
                                
-                               //
                                output.println("     ConflictNode* node;");
                                for (Iterator iterator = connectedSet.iterator(); iterator
                                                .hasNext();) {
                                        Integer integer = (Integer) iterator.next();
-                                       //output.print(" "+integer);
                                        if(integer.intValue()<0){
-                                               output.println("     node=mlpCreateConflictNode(seseCaller->classID);");
+                                               output.println("     node=mlpCreateConflictNode(parentCommon->classID);");
                                        }else{
                                                output.println("     node=mlpCreateConflictNode( "+integer+" );");
                                        }
                                        output.println("     addNewItem(seseToIssue->common.connectedList,node);");
                                }
-                               //
                                
                                output
                                                .println("     pthread_mutex_lock( &(parentCommon->lock) );");
@@ -3639,10 +3636,14 @@ public class BuildCode {
        output.println("   struct QueueItem* nextQueueItem;");
        output.println("   for(idx = 0 ; idx < ___params___->common.parent->numRelatedAllocSites ; idx++){");
        output.println("     if(!isEmpty(___params___->common.parent->allocSiteArray[idx].waitingQueue)){");
-       output.println("     SESEcommon* item=peekItem(___params___->common.parent->allocSiteArray[idx].waitingQueue);");
-       output.println("     if( item->classID == ___params___->common.classID ){");
-       output.println("        struct QueueItem* qItem=findItem(___params___->common.parent->allocSiteArray[idx].waitingQueue,item);");
-       output.println("        removeItem(___params___->common.parent->allocSiteArray[idx].waitingQueue,qItem);");
+       output.println("        struct QueueItem* qItem=getHead(___params___->common.parent->allocSiteArray[idx].waitingQueue);");
+       output.println("        while(qItem!=NULL){");
+       output.println("           SESEcommon* item=qItem->objectptr;");
+       output.println("           if(item->classID==___params___->common.classID){");
+       output.println("              removeItem(___params___->common.parent->allocSiteArray[idx].waitingQueue,qItem);");
+       output.println("           }");
+       output.println("           qItem=getNextQueueItem(qItem);");
+       output.println("        }");
        output.println("        if( !isEmpty(___params___->common.parent->allocSiteArray[idx].waitingQueue) ){");
        
        output.println("           struct QueueItem* nextQItem=getHead(___params___->common.parent->allocSiteArray[idx].waitingQueue);");
@@ -3664,10 +3665,12 @@ public class BuildCode {
        output.println("              }else{");
        output.println("                 if(isResolved){");
        output.println("                    pthread_mutex_lock( &(nextItem->lock) );");
-       output.println("                    --(nextItem->unresolvedDependencies);");
-       output.println("                    if( nextItem->unresolvedDependencies == 0){");
-       //output.println("                       workScheduleSubmit( (void*)nextItem);");
-       output.println("                         addNewItem(launchQueue,(void*)nextItem);");
+       output.println("                    if(nextItem->unresolvedDependencies > 0){");
+       output.println("                       --(nextItem->unresolvedDependencies);");
+       output.println("                       if( nextItem->unresolvedDependencies == 0){");
+       //output.println("                          workScheduleSubmit( (void*)nextItem);");
+       output.println("                            addNewItem(launchQueue,(void*)nextItem);");
+       output.println("                       }");
        output.println("                    }");
        output.println("                    pthread_mutex_unlock( &(nextItem->lock) );");
        output.println("                 }");
@@ -3676,7 +3679,7 @@ public class BuildCode {
        output.println("           } "); // end of while(nextQItem!=NULL)
        output.println("        }");
        output.println("     }");
-       output.println("  }");
+//     output.println("  }");
        output.println("  }");
        output.println("  pthread_mutex_unlock( &(___params___->common.parent->lock)  );");
        output.println("  if(!isEmpty(launchQueue)){");