bug fixes for oooJava, some debug events for coreprof for exploring things not worth...
authorjjenista <jjenista>
Wed, 13 Oct 2010 23:16:56 +0000 (23:16 +0000)
committerjjenista <jjenista>
Wed, 13 Oct 2010 23:16:56 +0000 (23:16 +0000)
Robust/src/Benchmarks/oooJava/master-makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/coreprof/coreprof.h

index edb433a71aebb7ec50dcb4a786682af01bbcf450..df12093a95b4f2a02ad795bab3458d228decb154 100644 (file)
@@ -13,12 +13,13 @@ BUILDSCRIPT=../../../buildscript
 
 
 COREPROFOVERFLOW= #-coreprof-checkoverflow
-USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
-#      -coreprof-eventwords 1024*1024*128 \
-#      -coreprof-enable cpe_main \
-#      -coreprof-enable cpe_taskdispatch \
-#      -coreprof-enable cpe_runmalloc
-#      -coreprof-enable cpe_taskexecute \
+USECOREPROF= #coreprof $(COREPROFOVERFLOW) \
+       -coreprof-eventwords 1024*1024*128 \
+       -coreprof-enable cpe_main \
+       -coreprof-enable cpe_runmalloc \
+       -coreprof-enable cpe_taskexecute \
+       -coreprof-enable cpe_taskdispatch
+#      -coreprof-enable cpe_preparememq
 #      -coreprof-enable cpe_runfree \
 #      -coreprof-enable cpe_count_poolalloc \
 #      -coreprof-enable cpe_count_poolreuse \
@@ -28,8 +29,8 @@ USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
 #      -coreprof-enable cpe_taskstallmem
 
 
-USEOOO= -ooojava 24 2 -ooodebug-disable-task-mem-pool -ooodebug 
-BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 1024 -garbagestats -joptimize -noloop -optimize #-debug
+USEOOO= -ooojava 24 2 #-ooodebug-disable-task-mem-pool #-ooodebug 
+BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 8000 -garbagestats -joptimize -noloop -optimize #src-after-pp #-debug
 
 DRELEASEMODE=-disjoint-release-mode -disjoint-dvisit-stack-callees-on-top -disjoint-alias-file aliases.txt tabbed
 DISJOINT= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) #-disjoint-desire-determinism
@@ -46,6 +47,7 @@ ooo:
 clean:
        rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin
        rm -fr par sing
+       rm -f tmp.c
        rm -f  *~
        rm -f  *.dot
        rm -f  *.png
index aaf0d431dfe681df37fcf0ebf951e719fec63cf2..7c9e338c8b23948a58d3c9d00d38683bc080955e 100644 (file)
@@ -1888,7 +1888,7 @@ public class BuildCode {
          Iterator<SESEandAgePair> pItr = callerSESEplaceholder.getNeededStaticNames().iterator();
          while( pItr.hasNext() ) {
            SESEandAgePair pair = pItr.next();
-           output.println("   void* "+pair+";");
+           output.println("   void* "+pair+" = NULL;");
          }
 
          // declare variables for tracking dynamic sources
@@ -3700,7 +3700,8 @@ public class BuildCode {
       output.println("     CP_LOGEVENT( CP_EVENTID_TASKDISPATCH, CP_EVENTTYPE_BEGIN );");
       output.println("#endif");
     }
-    
+
+
     // before doing anything, lock your own record and increment the running children
     if( (state.MLP     && fsen != mlpa.getMainSESE()) || 
         (state.OOOJAVA && fsen != oooa.getMainSESE())
@@ -3708,14 +3709,21 @@ public class BuildCode {
       output.println("     atomic_inc(&(runningSESE->numRunningChildren));");
     }
 
+
+
+
     // allocate the space for this record
     output.println( "#ifndef OOO_DISABLE_TASKMEMPOOL" );
     if( (state.MLP     && fsen != mlpa.getMainSESE()) || 
         (state.OOOJAVA && fsen != oooa.getMainSESE())
         ) {
+
+      //output.println("     CP_LOGEVENT( CP_EVENTID_DEBUG_B, CP_EVENTTYPE_BEGIN );");    
       output.println("     "+
                      fsen.getSESErecordName()+"* seseToIssue = ("+
                      fsen.getSESErecordName()+"*) poolalloc( runningSESE->taskRecordMemPool );");
+      //output.println("     CP_LOGEVENT( CP_EVENTID_DEBUG_B, CP_EVENTTYPE_END );");
+
     } else {
       output.println("     "+
                      fsen.getSESErecordName()+"* seseToIssue = ("+
@@ -3730,6 +3738,10 @@ public class BuildCode {
     output.println( "#endif // OOO_DISABLE_TASKMEMPOOL" );
 
 
+
+
+
+
     // set up the SESE in-set and out-set objects, which look
     // like a garbage list
     output.println("     struct garbagelist * gl= (struct garbagelist *)&(((SESEcommon*)(seseToIssue))[1]);");
@@ -3804,6 +3816,7 @@ public class BuildCode {
     // before potentially adding this SESE to other forwarding lists,
     // create it's lock
     output.println("     pthread_mutex_init( &(seseToIssue->common.lock), NULL );");
+
   
     if( (state.MLP && fsen != mlpa.getMainSESE()) ||
         (state.OOOJAVA && fsen != oooa.getMainSESE())    
@@ -3889,6 +3902,8 @@ public class BuildCode {
       }
 
       
+
+
       // maintain pointers for finding dynamic SESE 
       // instances from static names      
       SESEandAgePair pairNewest = new SESEandAgePair( fsen, 0 );
@@ -3896,22 +3911,27 @@ public class BuildCode {
       if(  fsen.getParent() != null && 
           fsen.getParent().getNeededStaticNames().contains( pairNewest ) 
        ) {       
+        output.println("     {");
+        output.println("#ifndef OOO_DISABLE_TASKMEMPOOL" );
+        output.println("       SESEcommon* oldest = "+pairOldest+";");
+        output.println("#endif // OOO_DISABLE_TASKMEMPOOL" );
 
        for( int i = fsen.getOldestAgeToTrack(); i > 0; --i ) {
          SESEandAgePair pair1 = new SESEandAgePair( fsen, i   );
          SESEandAgePair pair2 = new SESEandAgePair( fsen, i-1 );
-         output.println("     "+pair1+" = "+pair2+";");
+         output.println("       "+pair1+" = "+pair2+";");
        }      
-       output.println("     "+pairNewest+" = &(seseToIssue->common);");
+       output.println("       "+pairNewest+" = &(seseToIssue->common);");
 
         // 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("#ifndef OOO_DISABLE_TASKMEMPOOL" );
-        output.println("     if( "+pairOldest+" != NULL ) {");
-        output.println("       RELEASE_REFERENCE_TO( "+pairOldest+" );");
-        output.println("     }");
+        output.println("       if( oldest != NULL ) {");
+        output.println("         RELEASE_REFERENCE_TO( oldest );");
+        output.println("       }");
         output.println("#endif // OOO_DISABLE_TASKMEMPOOL" );
+        output.println("     }");
       }
 
       if (state.RCR) {
@@ -3926,6 +3946,13 @@ public class BuildCode {
       }
 
 
+      if( state.COREPROF ) {
+        output.println("#ifdef CP_EVENTID_PREPAREMEMQ");
+        output.println("     CP_LOGEVENT( CP_EVENTID_PREPAREMEMQ, CP_EVENTTYPE_BEGIN );");
+        output.println("#endif");
+      }
+
+
       ////////////////
       // count up memory conflict dependencies,
       // eom
@@ -4175,6 +4202,12 @@ public class BuildCode {
       }
     }
 
+    if( state.COREPROF ) {
+      output.println("#ifdef CP_EVENTID_PREPAREMEMQ");
+      output.println("     CP_LOGEVENT( CP_EVENTID_PREPAREMEMQ, CP_EVENTTYPE_END );");
+      output.println("#endif");
+    }
+    
     // Enqueue Task Record
     if (state.RCR) {
       output.println("    enqueueTR((void *)seseToIssue);");
@@ -4185,6 +4218,8 @@ public class BuildCode {
     output.println("       workScheduleSubmit( (void*)seseToIssue );");
     output.println("     }");
 
+    
+
     if( state.COREPROF ) {
       output.println("#ifdef CP_EVENTID_TASKDISPATCH");
       output.println("     CP_LOGEVENT( CP_EVENTID_TASKDISPATCH, CP_EVENTTYPE_END );");
index 67f7ba859db3b12db07360018819153597b71440..f44002a8c3f996dac2fa83a402969d97f98d430b 100644 (file)
 #define CP_EVENTID_TASKDISPATCH       0x30
 #endif
 
+#ifdef cpe_preparememq
+#define CP_EVENTID_PREPAREMEMQ        0x31
+#endif
+
 #ifdef cpe_taskexecute
-#define CP_EVENTID_TASKEXECUTE        0x31
+#define CP_EVENTID_TASKEXECUTE        0x40
 #endif
 
 #ifdef cpe_taskretire
-#define CP_EVENTID_TASKRETIRE         0x32
+#define CP_EVENTID_TASKRETIRE         0x50
 #endif
 
 #ifdef cpe_taskstallvar
-#define CP_EVENTID_TASKSTALLVAR       0x40
+#define CP_EVENTID_TASKSTALLVAR       0x60
 #endif
 
 #ifdef cpe_taskstallmem
-#define CP_EVENTID_TASKSTALLMEM       0x41
-#endif
+#define CP_EVENTID_TASKSTALLMEM       0x61
+#endif
+
+// debug events don't require a preprocessor
+// guard because normally they are not in the code
+// base--its helpful to define them in case you
+// want to debug events that aren't worth keeping
+// forever
+#define CP_EVENTID_DEBUG_A 0x180
+#define CP_EVENTID_DEBUG_B 0x181
+#define CP_EVENTID_DEBUG_C 0x182
+#define CP_EVENTID_DEBUG_D 0x183
+#define CP_EVENTID_DEBUG_E 0x184
+#define CP_EVENTID_DEBUG_F 0x185
+#define CP_EVENTID_DEBUG_G 0x186
+#define CP_EVENTID_DEBUG_H 0x187
+#define CP_EVENTID_DEBUG_I 0x188
+#define CP_EVENTID_DEBUG_J 0x189
 
 
 // Note: application-specific events (assigned