ok, this is a wacky commit, purposefully leaving a half-implemented forward Q change...
authorjjenista <jjenista>
Tue, 12 Oct 2010 22:22:30 +0000 (22:22 +0000)
committerjjenista <jjenista>
Tue, 12 Oct 2010 22:22:30 +0000 (22:22 +0000)
Robust/src/Benchmarks/oooJava/master-makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/mlp_runtime.h
Robust/src/Tests/disjoint/tiny/makefile

index 56ae7f057d9b0c3e492e98870e658e82a1306421..edb433a71aebb7ec50dcb4a786682af01bbcf450 100644 (file)
@@ -14,11 +14,11 @@ BUILDSCRIPT=../../../buildscript
 
 COREPROFOVERFLOW= #-coreprof-checkoverflow
 USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
-       -coreprof-eventwords 1024*1024*128 \
-       -coreprof-enable cpe_main \
-       -coreprof-enable cpe_taskdispatch
+#      -coreprof-eventwords 1024*1024*128 \
+#      -coreprof-enable cpe_main \
+#      -coreprof-enable cpe_taskdispatch \
+#      -coreprof-enable cpe_runmalloc
 #      -coreprof-enable cpe_taskexecute \
-#      -coreprof-enable cpe_runmalloc \
 #      -coreprof-enable cpe_runfree \
 #      -coreprof-enable cpe_count_poolalloc \
 #      -coreprof-enable cpe_count_poolreuse \
@@ -28,7 +28,7 @@ USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
 #      -coreprof-enable cpe_taskstallmem
 
 
-USEOOO= -ooojava 24 2  -ooodebug -ooodebug-disable-task-mem-pool 
+USEOOO= -ooojava 24 2 -ooodebug-disable-task-mem-pool -ooodebug 
 BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 1024 -garbagestats -joptimize -noloop -optimize #-debug
 
 DRELEASEMODE=-disjoint-release-mode -disjoint-dvisit-stack-callees-on-top -disjoint-alias-file aliases.txt tabbed
index aca3697b1431a5d43b10b13e02aa893a195d1d94..600808612eb47034bec9fa836430cc0b23b61817 100644 (file)
@@ -3734,6 +3734,9 @@ public class BuildCode {
     output.println("     psem_init( &(seseToIssue->common.stallSem) );");
 
     output.println("     seseToIssue->common.forwardList = createQueue();");
+    //output.println("     seseToIssue->common.forwardList.numItems    = 0;");
+    //output.println("     seseToIssue->common.forwardList.nextElement = NULL;");
+
     output.println("     seseToIssue->common.unresolvedDependencies = 10000;");
     output.println("     pthread_cond_init( &(seseToIssue->common.doneCond), NULL );");
     output.println("     seseToIssue->common.doneExecuting = FALSE;");    
@@ -3787,24 +3790,27 @@ public class BuildCode {
        SESEandAgePair srcPair = staticSrcsItr.next();
        output.println("     {");
        output.println("       SESEcommon* src = (SESEcommon*)"+srcPair+";");
-       //eomgc
+
+
        if(GENERATEPRECISEGC){
-               output.println("       stopforgc((struct garbagelist *)&___locals___);");
+          output.println("       stopforgc((struct garbagelist *)&___locals___);");
        }
+
        output.println("       pthread_mutex_lock( &(src->lock) );");
-       if(GENERATEPRECISEGC){
-               output.println("       restartaftergc();");
+       
+        if(GENERATEPRECISEGC){
+          output.println("       restartaftergc();");
        }
-       output.println("       if( !isEmpty( src->forwardList ) &&");
-       output.println("           seseToIssue == peekItem( src->forwardList ) ) {");
-       output.println("         printf( \"This shouldnt already be here\\n\");");
-       output.println("         exit( -1 );");
-       output.println("       }");
+
+        // FORWARD TODO
        output.println("       if( !src->doneExecuting ) {");
-       output.println("         addNewItem( src->forwardList, seseToIssue );");
+        output.println("         addNewItem( src->forwardList, seseToIssue );");       
+        //output.println("         ADD_FORWARD_ITEM( src->forwardList, seseToIssue );");
        output.println("         ++(localCount);");
        output.println("       }");
+        output.println("#ifndef OOO_DISABLE_TASKMEMPOOL" );
         output.println("       ADD_REFERENCE_TO( src );");
+        output.println("#endif" );
        output.println("       pthread_mutex_unlock( &(src->lock) );");
        output.println("     }");
 
@@ -3835,6 +3841,9 @@ public class BuildCode {
        if(GENERATEPRECISEGC){
                output.println("         restartaftergc();");
        }
+
+        // FORWARD TODO
+
        output.println("         if( isEmpty( src->forwardList ) ||");
        output.println("             seseToIssue != peekItem( src->forwardList ) ) {");
        output.println("           if( !src->doneExecuting ) {");
@@ -3842,7 +3851,9 @@ public class BuildCode {
        output.println("             ++(localCount);");
        output.println("           }");
        output.println("         }");
+        output.println("#ifndef OOO_DISABLE_TASKMEMPOOL" );
         output.println("         ADD_REFERENCE_TO( src );");
+        output.println("#endif" );
        output.println("         pthread_mutex_unlock( &(src->lock) );");       
        output.println("         seseToIssue->"+dynInVar+"_srcOffset = "+dynInVar+"_srcOffset;");
        output.println("       } else {");
@@ -4299,6 +4310,8 @@ public class BuildCode {
     output.println("   pthread_mutex_unlock( &("+com+".lock) );");
 
     // decrement dependency count for all SESE's on your forwarding list
+
+    // FORWARD TODO
     output.println("   while( !isEmpty( "+com+".forwardList ) ) {");
     output.println("     SESEcommon* consumer = (SESEcommon*) getItem( "+com+".forwardList );");
     
index 21c86d96513aaff63b5fbe9c14eceb110c2dd330..6a2972ea1cb44d24af1dabe3076c0b3cdac7205e 100644 (file)
 #endif
 
 
+// these are useful for interpreting an INTPTR to an
+// Object at runtime to retrieve the object's type
+// or object id (OID), 64-bit safe
 #define OBJPTRPTR_2_OBJTYPE( opp ) ((int*)(*(opp)))[0]
 #define OBJPTRPTR_2_OBJOID(  opp ) ((int*)(*(opp)))[1]
 
 
 
+// forwarding list elements is a linked
+// structure of arrays, should help task
+// dispatch because the first element is
+// an embedded member of the task record,
+// only have to do memory allocation if
+// a lot of items are on the list
+#define FLIST_ITEMS_PER_ELEMENT 30
+typedef struct ForwardingListElement_t {
+  int                             numItems;
+  struct ForwardingListElement_t* nextElement;
+  INTPTR                          items[FLIST_ITEMS_PER_ELEMENT];
+} ForwardingListElement;
+
+
+
 // these fields are common to any SESE, and casting the
 // generated SESE record to this can be used, because
 // the common structure is always the first item in a
@@ -76,7 +94,12 @@ typedef struct SESEcommon_t {
   // use to coordinate with one another
   pthread_mutex_t lock;
 
-  struct Queue*   forwardList;
+  // NOTE: first element is embedded in the task
+  // record, so don't free it!
+  //ForwardingListElement forwardList;
+  struct Queue* forwardList;
+
+
   volatile int    unresolvedDependencies;
 
   pthread_cond_t  doneCond;
@@ -115,7 +138,9 @@ extern __thread SESEcommon* runningSESE;
 
 
 typedef struct REntry_t{
-  int type; // fine read:0, fine write:1, parent read:2, parent write:3 coarse: 4, parent coarse:5, scc: 6
+  // fine read:0, fine write:1, parent read:2, 
+  // parent write:3 coarse: 4, parent coarse:5, scc: 6
+  int type;
   struct Hashtable_t* hashtable;
   struct BinItem_t* binitem;
   struct Vector_t* vector;
@@ -187,6 +212,15 @@ void RETIRERENTRY(MemoryQueue* Q, REntry * r);
 
 
 
+
+static inline void ADD_FORWARD_ITEM( ForwardingListElement* e,
+                                     SESEcommon*            s ) {
+  //atomic_inc( &(s->refCount) );
+}
+
+
+
+
 // simple mechanical allocation and 
 // deallocation of SESE records
 void* mlpAllocSESErecord( int size );
@@ -200,17 +234,13 @@ void rehashMemoryQueue(SESEcommon* seseParent);
 
 
 static inline void ADD_REFERENCE_TO( SESEcommon* seseRec ) {
-#ifndef OOO_DISABLE_TASKMEMPOOL
   atomic_inc( &(seseRec->refCount) );
-#endif
 }
 
 static inline void RELEASE_REFERENCE_TO( SESEcommon* seseRec ) {
-#ifndef OOO_DISABLE_TASKMEMPOOL
   if( atomic_sub_and_test( 1, &(seseRec->refCount) ) ) {
     poolfreeinto( seseRec->parent->taskRecordMemPool, seseRec );
   }
-#endif
 }
 
 
index 5f210cabce9a9d7d18eefccda26ba98783f59a5f..855ef13372171acf3847868e90f9b50a219994d7 100644 (file)
@@ -3,7 +3,7 @@ PROGRAM=test
 SOURCE_FILES=$(PROGRAM).java
 
 BUILDSCRIPT=~/research/Robust/src/buildscript
-BSFLAGS= -mainclass Test -disjoint -disjoint-k 1 -disjoint-alias-file aliases.txt normal -enable-assertions -justanalyze #-joptimize #-disjoint-write-dots final
+BSFLAGS= -mainclass Test #-disjoint -disjoint-k 1 -disjoint-alias-file aliases.txt normal -enable-assertions -justanalyze -flatirusermethods #-joptimize #-disjoint-write-dots final
 
 all: $(PROGRAM).bin