there is definitely an uninitialized mem bug, temp fix is to zero allocated task...
authorjjenista <jjenista>
Fri, 24 Sep 2010 19:48:00 +0000 (19:48 +0000)
committerjjenista <jjenista>
Fri, 24 Sep 2010 19:48:00 +0000 (19:48 +0000)
Robust/src/Benchmarks/oooJava/sor/makefile
Robust/src/Benchmarks/oooJava/sor/runs [new file with mode: 0755]
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/memPool.h
Robust/src/Runtime/mlp_runtime.h
Robust/src/Tests/oooJava/poolalloc/makefile

index 6e5193b52416cb08a28a158dd89eba9678487f7c..4f8d6da4437f02df6a54ec5894c45222e41f1488 100644 (file)
@@ -5,7 +5,10 @@ SOURCE_FILES=JGFSORBenchSizeD.java
 BUILDSCRIPT=../../../buildscript
 
 USEOOO= -ooojava 24 2  -ooodebug  
-BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 6*1024 -garbagestats -debug -joptimize -noloop -optimize #-coreprof -coreprof-eventwords 1024*1024*128 #-coreprof-checkoverflow 
+
+BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 6*1024 -garbagestats -debug -joptimize -noloop -optimize -ooodebug-disable-task-mem-pool
+#-coreprof -coreprof-eventwords 1024*1024*128 #-coreprof-checkoverflow 
+
 DISJOINT= -disjoint -disjoint-k 1 -enable-assertions #-disjoint-desire-determinism
 
 default:
diff --git a/Robust/src/Benchmarks/oooJava/sor/runs b/Robust/src/Benchmarks/oooJava/sor/runs
new file mode 100755 (executable)
index 0000000..67fdaa1
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+time ./JGFSORBenchSizeDs.bin
index 9f94c88650867440bc24d5d8540b7252bb5ee47c..884f9a1f504b2f801721e81e31b16ba5797d911b 100644 (file)
@@ -405,6 +405,7 @@ public class BuildCode {
                           " ); }" );
       }
       
+      outmethod.println("  runningSESE = NULL;");
 
       outmethod.println("  workScheduleInit( "+state.MLP_NUMCORES+", invokeSESEmethod );");
       
@@ -3639,30 +3640,12 @@ public class BuildCode {
     if( state.COREPROF ) {
       output.println("CP_LOGEVENT( CP_EVENTID_TASKDISPATCH, CP_EVENTTYPE_BEGIN );");
     }
-
-    // set up the parent
-    if( (state.MLP && fsen == mlpa.getMainSESE()) || 
-         (state.OOOJAVA && fsen == oooa.getMainSESE()) 
-    ) {
-      output.println("     SESEcommon* parentCommon = NULL;");
-    } else {
-      if( fsen.getParent() == null ) {
-       System.out.println( "in "+fm+", "+fsen+" has null parent" );
-      }
-      assert fsen.getParent() != null;
-      if( !fsen.getParent().getIsCallerSESEplaceholder() ) {
-       output.println("     SESEcommon* parentCommon = &("+paramsprefix+"->common);");
-      } else {
-       //output.println("     SESEcommon* parentCommon = (SESEcommon*) peekItem( seseCallStack );");
-       output.println("     SESEcommon* parentCommon = runningSESE;");
-      }
-    }
     
     // before doing anything, lock your own record and increment the running children
     if( (state.MLP && fsen != mlpa.getMainSESE()) || 
          (state.OOOJAVA && fsen != oooa.getMainSESE())
     ) {      
-      output.println("     atomic_inc(&parentCommon->numRunningChildren);");
+      output.println("     atomic_inc(&(runningSESE->numRunningChildren));");
     }
 
     // allocate the space for this record
@@ -3720,8 +3703,12 @@ public class BuildCode {
     output.println("     seseToIssue->common.doneExecuting = FALSE;");    
     output.println("     pthread_cond_init( &(seseToIssue->common.runningChildrenCond), NULL );");
     output.println("     seseToIssue->common.numRunningChildren = 0;");
-    output.println("     seseToIssue->common.parent = parentCommon;");
-    output.println("     seseToIssue->common.refCount = 1;");
+    output.println("     seseToIssue->common.parent = runningSESE;");
+    // start with refCount = 2, one being the count that the child itself
+    // will decrement when it retires, to say it is done using its own
+    // record, and the other count is for the parent that will remember
+    // the static name of this new child below
+    output.println("     seseToIssue->common.refCount = 2;");
 
     // all READY in-vars should be copied now and be done with it
     Iterator<TempDescriptor> tempItr = fsen.getReadyInVarSet().iterator();
@@ -3865,19 +3852,26 @@ public class BuildCode {
        }      
        output.println("     "+pairNewest+" = &(seseToIssue->common);");
       }
-      // add a reference to whatever is the newest record after the shift
-      // and release a reference to whatever was the oldest BEFORE the shift
-      output.println("     ADD_REFERENCE_TO( "+pairNewest+" );");
+      // no need to add a reference to whatever is the newest record, because
+      // we initialized seseToIssue->refCount to *2*
+      // but release a reference to whatever was the oldest BEFORE the shift
       output.println("     if( "+pairOldest+" != NULL ) {");
       output.println("       RELEASE_REFERENCE_TO( "+pairOldest+" );");
       output.println("     }");
 
       
+
+
       ////////////////
       // count up memory conflict dependencies,
       // eom
       if(state.OOOJAVA){
 
+        //output.println("       seseToIssue->common.numMemoryQueue=0;");
+        //output.println("       seseToIssue->common.rentryIdx=0;");
+        //output.println("       seseToIssue->common.unresolvedRentryIdx=0;");
+        //output.println("       seseToIssue->common.memoryQueueArray=NULL;");
+
         FlatSESEEnterNode parent = fsen.getParent();
         Analysis.OoOJava.ConflictGraph graph = oooa.getConflictGraph(parent);
         if (graph != null && graph.hasConflictEdge()) {
@@ -3901,7 +3895,7 @@ public class BuildCode {
                 seseWaitingQueue.getWaitingElementSet(queueID);
               int enqueueType=seseWaitingQueue.getType(queueID);
               if(enqueueType==SESEWaitingQueue.EXCEPTION){
-                output.println("       INITIALIZEBUF(parentCommon->memoryQueueArray["
+                output.println("       INITIALIZEBUF(runningSESE->memoryQueueArray["
                                + queueID+ "]);");
               }
               for (Iterator iterator2 = waitingQueueSet.iterator(); iterator2.hasNext();) {
@@ -3952,13 +3946,13 @@ public class BuildCode {
                                    + ");");
                   }
                 }
-                output.println("       rentry->queue=parentCommon->memoryQueueArray["
+                output.println("       rentry->queue=runningSESE->memoryQueueArray["
                                + waitingElement.getQueueID()
                                + "];");
                 
                 if(enqueueType==SESEWaitingQueue.NORMAL){
                   output.println("       seseToIssue->common.rentryArray[seseToIssue->common.rentryIdx++]=rentry;");
-                  output.println("       if(ADDRENTRY(parentCommon->memoryQueueArray["
+                  output.println("       if(ADDRENTRY(runningSESE->memoryQueueArray["
                                  + waitingElement.getQueueID()
                                  + "],rentry)==NOTREADY){");
                   output.println("          ++(localCount);");
@@ -3988,13 +3982,13 @@ public class BuildCode {
                   }
                 }else{
                   output
-                    .println("       ADDRENTRYTOBUF(parentCommon->memoryQueueArray["
+                    .println("       ADDRENTRYTOBUF(runningSESE->memoryQueueArray["
                              + waitingElement.getQueueID()
                              + "],rentry);");
                 }
               }
               if(enqueueType!=SESEWaitingQueue.NORMAL){
-                output.println("       localCount+=RESOLVEBUF(parentCommon->memoryQueueArray["
+                output.println("       localCount+=RESOLVEBUF(runningSESE->memoryQueueArray["
                                + queueID+ "],&seseToIssue->common);");
               }       
             }
@@ -4034,7 +4028,7 @@ public class BuildCode {
               Set<WaitingElement> waitingQueueSet =  seseWaitingQueue.getWaitingElementSet(queueID);
               int enqueueType=seseWaitingQueue.getType(queueID);
               if(enqueueType==SESEWaitingQueue.EXCEPTION){
-                output.println("     INITIALIZEBUF(parentCommon->memoryQueueArray["
+                output.println("     INITIALIZEBUF(runningSESE->memoryQueueArray["
                                + queueID+ "]);");
               }
               for (Iterator iterator2 = waitingQueueSet.iterator(); iterator2
@@ -4099,7 +4093,7 @@ public class BuildCode {
                   }
                 }
                 output
-                  .println("     rentry->queue=parentCommon->memoryQueueArray["
+                  .println("     rentry->queue=runningSESE->memoryQueueArray["
                            + waitingElement.getQueueID()
                            + "];");
                                                        
@@ -4107,20 +4101,20 @@ public class BuildCode {
                   output
                     .println("     seseToIssue->common.rentryArray[seseToIssue->common.rentryIdx++]=rentry;");
                   output
-                    .println("     if(ADDRENTRY(parentCommon->memoryQueueArray["
+                    .println("     if(ADDRENTRY(runningSESE->memoryQueueArray["
                              + waitingElement.getQueueID()
                              + "],rentry)==NOTREADY){");
                   output.println("        ++(localCount);");
                   output.println("     } ");
                 }else{
                   output
-                    .println("     ADDRENTRYTOBUF(parentCommon->memoryQueueArray["
+                    .println("     ADDRENTRYTOBUF(runningSESE->memoryQueueArray["
                              + waitingElement.getQueueID()
                              + "],rentry);");
                 }
               }
               if(enqueueType!=SESEWaitingQueue.NORMAL){
-                output.println("     localCount+=RESOLVEBUF(parentCommon->memoryQueueArray["
+                output.println("     localCount+=RESOLVEBUF(runningSESE->memoryQueueArray["
                                + queueID+ "],&seseToIssue->common);");
               }                                
             }
@@ -4453,14 +4447,6 @@ public class BuildCode {
 
   private void generateFlatCall(FlatMethod fm, LocalityBinding lb, FlatCall fc, PrintWriter output) {
 
-    /*
-    if( (state.MLP && !nonSESEpass) || 
-        (state.OOOJAVA && !nonSESEpass)
-    ) {
-      output.println("     runningSESE = (SESEcommon*)"+paramsprefix+";");
-    }
-    */
-
     MethodDescriptor md=fc.getMethod();
     ParamsObject objectparams=(ParamsObject)paramstable.get(lb!=null ? locality.getBinding(lb, fc) : md);
     ClassDescriptor cn=md.getClassDesc();
index 0bd4bad18c13f580689d53e834fcc3f1b327ac3b..356e15e8f3cb1cb9380798a0c3ecc9057d1349d3 100644 (file)
 //////////////////////////////////////////////////////////
 
 #include <stdlib.h>
+
+// just until uninitialized mem bug found
+#include <string.h>
+
 #include "mlp_lock.h"
 
 
@@ -109,10 +113,17 @@ static inline void* poolalloc( MemPool* p ) {
 
   if( headCurrent->next == NULL ) {
     // only one item, so don't take from pool
+    //return malloc( p->itemSize );
+
+    // just until uninitialized mem bug found
     return calloc( 1, p->itemSize );
   }
  
   p->head = headCurrent->next;
+
+  // just until uninitialized mem bug found
+  memset( headCurrent, 0, p->itemSize );
+
   return headCurrent;
 }
 
index 4e351a50974a73fac14bffc48908328d3cf24d58..21c86d96513aaff63b5fbe9c14eceb110c2dd330 100644 (file)
@@ -87,8 +87,8 @@ typedef struct SESEcommon_t {
 
   struct SESEcommon_t*   parent;
 
-  psemaphore parentStallSem;
-  pthread_cond_t stallDone;
+  //psemaphore parentStallSem;
+  //pthread_cond_t stallDone;
 
   int numMemoryQueue;
   int rentryIdx;
index d9de92378554ccc8b54685bed362eaf705847a85..68d446445173074e969d7be35c6db9424f8f359d 100644 (file)
@@ -5,7 +5,7 @@ SOURCE_FILES=test.java
 BUILDSCRIPT=../../../buildscript
 
 USEOOO= -ooojava 24 2  -ooodebug  
-BSFLAGS= -64bit -mainclass $(PROGRAM) -heapsize-mb 1024 -garbagestats -noloop -nooptimize -coreprof -coreprof-checkoverflow -coreprof -coreprof-eventwords 1024*1024*128 -debug -ooodebug-disable-task-mem-pool
+BSFLAGS= -64bit -mainclass $(PROGRAM) -heapsize-mb 1024 -garbagestats -noloop -nooptimize -coreprof -coreprof-checkoverflow -coreprof -coreprof-eventwords 1024*1024*128 -debug #-ooodebug-disable-task-mem-pool
 DISJOINT= -disjoint -disjoint-k 1 -enable-assertions #-disjoint-desire-determinism
 
 all: ooo