changes
authorbdemsky <bdemsky>
Fri, 22 Oct 2010 22:27:47 +0000 (22:27 +0000)
committerbdemsky <bdemsky>
Fri, 22 Oct 2010 22:27:47 +0000 (22:27 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/RuntimeConflictResolver.java
Robust/src/Runtime/mlp_runtime.h
Robust/src/Runtime/oooJava/hashStructure.c
Robust/src/Runtime/workschedule.c

index bf81596be03aed0f1a66cce8609200d81b4b5b19..5076929492fc38552f6f60ed4e7f2718457a3814 100644 (file)
@@ -3254,10 +3254,14 @@ public class BuildCode {
                 }
                 if(state.RCR) {
                  //no need to enqueue parent effect if coarse grained conflict clears us
+                 output.println("       while(stallrecord.common.rcrstatus) ;");
+                 output.println("       BARRIER();");
                  output.println("       stallrecord.common.parentsStallSem=&rentry->parentStallSem;");
                  output.println("       stallrecord.tag=rentry->tag;");
                  output.println("       stallrecord.___obj___=(struct ___Object___ *)"+generateTemp(fm, waitingElement.getTempDesc(), null)+";");
                  output.println("       stallrecord.common.classID=-"+rcr.getTraverserID(waitingElement.getTempDesc(), fn)+";");
+                 //mark the record used..so we won't use it again until it is free
+                 output.println("       stallrecord.common.rcrstatus=1;");
                  output.println("       enqueueTR(TRqueue, (void *)&stallrecord);");
                 }
                output.println("        psem_take( &(rentry->parentStallSem), (struct garbagelist *)&___locals___ );");
index b97486c60cb16e2e7d258d71858c07627b665933..f852c54de5b953269d6cc8505d2a90c90b9b6116 100644 (file)
@@ -725,6 +725,8 @@ public class RuntimeConflictResolver {
       //need to add this
       cFile.println("     if(atomic_sub_and_test(RUNBIAS-totalcount,&(record->rcrRecords[0].count))) {");
       cFile.println("         psem_give_tag(record->common.parentsStallSem, record->tag);");
+      cFile.println("         BARRIER();");
+      cFile.println("         record->common.rcrstatus=0;");
       cFile.println("}");
     } else {
       cFile.println("     if(atomic_sub_and_test(RUNBIAS-totalcount,&(record->rcrRecords["+index+"].count))) {");
index 419f0143be6d6326e0cf493d6488e4ed97da2225..ffd4548a04cace8b154165bee95884c18f8ef627 100644 (file)
@@ -100,7 +100,6 @@ typedef struct SESEcommon_t {
   //ForwardingListElement forwardList;
   struct Queue* forwardList;
 
-
   volatile int    unresolvedDependencies;
 
   pthread_cond_t  doneCond;
@@ -122,6 +121,7 @@ typedef struct SESEcommon_t {
   int offsetToDepSESErecords;
 #ifdef RCR
   int offsetToParamRecords;
+  volatile int rcrstatus;
 #endif
 
   // for determining when task records can be returned
index 24c17c864d9af68be06ae503cbbc1ed0211f4479..cab070441c0233b399c4e922c8ae81213f067f28 100644 (file)
@@ -402,6 +402,9 @@ void RESOLVE(SESEcommon *record, bitvt mask) {
       if(unlikely(record->classID<0)) {
        //parent stall...clear it
        psem_give_tag(record->parentsStallSem, ((SESEstall *)record)->tag);
+       //mark the record unused
+       BARRIER();
+       ((SESEstall *)record)->rcrstatus=0;
       } else {
        int flag=LOCKXCHG32(&array[index].flag,0);
        if (flag) {
index 26b5fb65ffdc813547ff33f1d3719be31f730de6..3119b66cfd00b3edbfa7d27f54658bb630695954 100644 (file)
@@ -105,6 +105,7 @@ void* workerMain( void* arg ) {
   //set up the stall site SESErecord
   stallrecord.common.offsetToParamRecords=(INTPTR) &((SESEstall *)0)->rcrRecords;
   stallrecord.common.classID=-1;
+  stallrecord.common.rcrstatus=0;
 
   if( TRqueue == NULL ) {
     TRqueue = allocTR();