change calloc to RUNMALLOC, added some optional debug deque bits
authorjjenista <jjenista>
Tue, 26 Oct 2010 17:57:19 +0000 (17:57 +0000)
committerjjenista <jjenista>
Tue, 26 Oct 2010 17:57:19 +0000 (17:57 +0000)
Robust/src/Benchmarks/oooJava/micro-master-makefile
Robust/src/Runtime/deque.c
Robust/src/Runtime/memPool.h
Robust/src/Runtime/mlp_runtime.h
Robust/src/Runtime/workschedule.c

index ea7663a4a3037a232cf06de9de1c630b6cf2a23f..307351bfea5b88b2811af3008e98954b5edd7a2a 100644 (file)
@@ -14,26 +14,26 @@ SOURCE_FILES=test.java
 BUILDSCRIPT=../../../buildscript
 
 
-COREPROFOVERFLOW= -coreprof-checkoverflow
-USECOREPROF= -coreprof $(COREPROFOVERFLOW) \
+COREPROFOVERFLOW= #-coreprof-checkoverflow
+USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
        -coreprof-eventwords 1024*1024*512 \
        -coreprof-enable cpe_main \
-       -coreprof-enable cpe_runmalloc \
+       -coreprof-enable cpe_workschedgrab
+#      -coreprof-enable cpe_runmalloc \
        -coreprof-enable cpe_taskexecute \
        -coreprof-enable cpe_taskdispatch \
        -coreprof-enable cpe_poolalloc \
        -coreprof-enable cpe_taskretire \
-       -coreprof-enable cpe_workschedgrab
-#      -coreprof-enable cpe_preparememq
-#      -coreprof-enable cpe_runfree \
-#      -coreprof-enable cpe_count_poolalloc \
-#      -coreprof-enable cpe_count_poolreuse \
-#      -coreprof-enable cpe_taskstallvar \
-#      -coreprof-enable cpe_taskstallmem
+       -coreprof-enable cpe_preparememq \
+       -coreprof-enable cpe_runfree \
+       -coreprof-enable cpe_count_poolalloc \
+       -coreprof-enable cpe_count_poolreuse \
+       -coreprof-enable cpe_taskstallvar \
+       -coreprof-enable cpe_taskstallmem
 
 
-USEOOO= -ooojava 24 2 #-ooodebug-disable-task-mem-pool #-ooodebug 
-BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 2000 -garbagestats -joptimize -noloop -debug #-debug-deque #-optimize src-after-pp
+USEOOO= -ooojava 8 2 #-ooodebug-disable-task-mem-pool #-ooodebug 
+BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 50 -garbagestats -joptimize -noloop -debug -debug-deque #-optimize src-after-pp
 
 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
index ca3f7521e59efe5f3e7d196761b93498ac481bae..a347c01aa507f9c0ae8dea782ab17234b5bad3a9 100644 (file)
@@ -65,11 +65,13 @@ const INTPTR DQNODE_SIZETOREQUEST = sizeof( dequeNode ) + 4095;
 
 static inline dequeNode* dqGet4096aligned( void* fromAllocator ) { 
   INTPTR aligned = ((INTPTR)fromAllocator + 4095) & (~4095);
+
 #ifdef DEBUG_DEQUE
-  printf( "from allocator: 0x%08x to 0x%08x\n", (INTPTR)fromAllocator, (INTPTR)fromAllocator + DQNODE_SIZETOREQUEST );
-  printf( "aligned:        0x%08x to 0x%08x\n", aligned,               aligned               + sizeof( dequeNode )  );
-  memset( (void*) aligned, 0, sizeof( dequeNode ) );
+  //printf( "from allocator: 0x%08x to 0x%08x\n", (INTPTR)fromAllocator, (INTPTR)fromAllocator + DQNODE_SIZETOREQUEST );
+  //printf( "aligned:        0x%08x to 0x%08x\n", aligned,               aligned               + sizeof( dequeNode )  );
+  //memset( (void*) aligned, 0, sizeof( dequeNode ) );
 #endif
+
   return (dequeNode*) aligned;
 }
 
@@ -137,6 +139,12 @@ void dqInit( deque* dq ) {
 
 void dqPushBottom( deque* dq, void* item ) {
 
+#ifdef DEBUG_DEQUE
+  if( item == 0x0 ) {
+    printf( "Pushing invalid work into the deque.\n" );
+  }
+#endif
+
   dequeNode* currNode = dqDecodePtr( dq->bottom );
   int        currIndx = dqDecodeIdx( dq->bottom );
 
index f2217c1791dc847bd2068fc00a81b4342beffbeb..582c7e9f379dd22549d022b5759aad21f89ad3d8 100644 (file)
@@ -45,9 +45,9 @@ typedef struct MemPool_t {
 // the memory pool must always have at least one
 // item in it
 static MemPool* poolcreate( int itemSize ) {
-  MemPool* p    = calloc( 1, sizeof( MemPool ) );
+  MemPool* p    = RUNMALLOC( sizeof( MemPool ) );
   p->itemSize   = itemSize;
-  p->head       = calloc( 1, itemSize );
+  p->head       = RUNMALLOC( itemSize );
   p->head->next = NULL;
   p->tail       = p->head;
   return p;
index bf0bc137068be2d0a788cc7bc1eaf3c51e47a3eb..02ec3c89bdfff730f2775b04b68da1f280b8b34c 100644 (file)
@@ -271,13 +271,13 @@ static inline void RELEASE_REFERENCE_TO( SESEcommon* seseRec ) {
 }
 
 static MemPool* taskpoolcreate( int itemSize ) {
-  MemPool* p    = calloc( 1, sizeof( MemPool ) );
+  MemPool* p    = RUNMALLOC( 1, sizeof( MemPool ) );
   SESEcommon *c = (SESEcommon *) p;
   pthread_cond_init( &(c->runningChildrenCond), NULL );
   pthread_mutex_init( &(c->lock), NULL );
 
   p->itemSize   = itemSize;
-  p->head       = calloc( 1, itemSize );
+  p->head       = RUNMALLOC( 1, itemSize );
   p->head->next = NULL;
   p->tail       = p->head;
   return p;
index 24c452f740cab7be255a3d69fe97c92bc05dc16d..24201db6a7314c5d2c89d3d26502f270db3264a5 100644 (file)
@@ -185,6 +185,12 @@ void* workerMain( void* arg ) {
 
       workUnit = dqPopBottom( myDeque );
 
+#ifdef DEBUG_DEQUE
+      if( workUnit == 0x0 ) {
+        printf( "Got invalid work from the deque bottom.\n" );
+      }
+#endif
+
       if( workUnit != DQ_POP_EMPTY ) {
         haveWork = TRUE;
         break;
@@ -195,6 +201,12 @@ void* workerMain( void* arg ) {
         // your own deque
         for( i = 0; i < numWorkSchedWorkers - 1; ++i ) {
           workUnit = dqPopTop( &(deques[lastVictim]) );
+
+#ifdef DEBUG_DEQUE
+          if( workUnit == 0x0 ) {
+            printf( "Got invalid work from the deque top.\n" );
+          }
+#endif
           
           if( workUnit != DQ_POP_ABORT &&
               workUnit != DQ_POP_EMPTY ) {
@@ -334,6 +346,12 @@ void workScheduleInit( int numProcessors,
 
 void workScheduleSubmit( void* workUnit ) {
 
+#ifdef DEBUG_DEQUE
+  if( workUnit == 0x0 ) {
+    printf( "Submitting invalid task record as work.\n" );
+  }
+#endif
+
   if( myWorkerID == workerID_NOTAWORKER ) {
     CP_LOGEVENT( CP_EVENTID_DEBUG_A, CP_EVENTTYPE_BEGIN );
     dqPushBottom( &(deques[0]), workUnit );