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 \
# -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
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;");
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(" }");
if(GENERATEPRECISEGC){
output.println(" restartaftergc();");
}
+
+ // FORWARD TODO
+
output.println(" if( isEmpty( src->forwardList ) ||");
output.println(" seseToIssue != peekItem( src->forwardList ) ) {");
output.println(" if( !src->doneExecuting ) {");
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 {");
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 );");
#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
// 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;
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;
+
+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 );
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
}
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