From: yeom Date: Thu, 7 Jan 2010 18:53:57 +0000 (+0000) Subject: bug fix. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fbfca5312f0871f76c0c6895860a6b17b70c5bf8;p=IRC.git bug fix. examine all elements in the waiting queue to allow more parallel execution. --- diff --git a/Robust/src/Analysis/MLP/ConflictGraph.java b/Robust/src/Analysis/MLP/ConflictGraph.java index 508dbfe4..512732a1 100644 --- a/Robust/src/Analysis/MLP/ConflictGraph.java +++ b/Robust/src/Analysis/MLP/ConflictGraph.java @@ -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 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; diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 8c94b32a..df5f82f5 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -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)){");