remove debug printouts
authorbdemsky <bdemsky>
Thu, 30 Jun 2011 08:46:27 +0000 (08:46 +0000)
committerbdemsky <bdemsky>
Thu, 30 Jun 2011 08:46:27 +0000 (08:46 +0000)
Robust/src/Runtime/bamboo/multicoregarbage.c
Robust/src/Runtime/bamboo/multicoregarbage.h
Robust/src/Runtime/bamboo/multicoregccompact.c
Robust/src/Runtime/bamboo/multicoregcflush.c
Robust/src/Runtime/bamboo/multicoregcmark.c
Robust/src/Runtime/bamboo/multicoremem.c

index 7f752aad0a51082454ea1343cb297e5cb83b5588..7a315a6a3c46216d584482d6f669a36fdc2958f9 100644 (file)
@@ -162,6 +162,7 @@ void initGC() {
 } 
 
 void checkMarkStatus_p2() {
+  //  tprintf("Check mark status 2\n");
   // check if the sum of send objs and receive obj are the same
   // yes->check if the info is the latest; no->go on executing
   unsigned int sumsendobj = 0;
@@ -181,6 +182,7 @@ void checkMarkStatus_p2() {
       }
     }  
     if(i == NUMCORESACTIVE) {    
+      //tprintf("Mark terminated\n");
       // all the core status info are the latest,stop mark phase
       gc_status_info.gcphase = COMPACTPHASE;
       // restore the gcstatus for all cores
@@ -204,6 +206,7 @@ void checkMarkStatus_p2() {
 }
 
 void checkMarkStatus() {
+  //  tprintf("Check mark status\n");
   if((!waitconfirm)||(waitconfirm && (numconfirm == 0))) {
     unsigned int entry_index = 0;
     if(waitconfirm) {
@@ -396,11 +399,13 @@ void master_finish() {
   CACHEADAPT_OUTPUT_CACHE_POLICY();
   gc_output_cache_policy_time += (BAMBOO_GET_EXE_TIME()-tmpt);
   gcflag = false;
+
   GC_SEND_MSG_1_TO_CLIENT(GCFINISH);
-  
-  gc_status_info.gcprocessing = false;
+  gc_status_info.gcprocessing = false;  
+
   if(gcflag) {
     // inform other cores to stop and wait for gc
+    GC_PRINTF("Back to Back gc case\n");
     gcprecheck = true;
     for(int i = 0; i < NUMCORESACTIVE; i++) {
       // reuse the gcnumsendobjs & gcnumreceiveobjs
@@ -412,7 +417,7 @@ void master_finish() {
 }
 
 void gc_master(struct garbagelist * stackptr) {
-  tprintf("start GC !!!!!!!!!!!!! \n");
+  //tprintf("start GC !!!!!!!!!!!!! \n");
   gc_status_info.gcprocessing = true;
   gc_status_info.gcphase = INITPHASE;
 
@@ -421,33 +426,32 @@ void gc_master(struct garbagelist * stackptr) {
   initGC();
   GC_SEND_MSG_1_TO_CLIENT(GCSTARTINIT);
   CACHEADAPT_GC(true);
-  GC_PRINTF("Check core status \n");
+  //tprintf("Check core status \n");
   GC_CHECK_ALL_CORE_STATUS();
   GCPROFILE_ITEM();
   unsigned long long tmpt = BAMBOO_GET_EXE_TIME();
   CACHEADAPT_OUTPUT_CACHE_SAMPLING();
   gc_output_cache_policy_time += (BAMBOO_GET_EXE_TIME()-tmpt);
-
+  //tprintf("start mark phase\n");
   // do mark phase
   master_mark(stackptr);
-
+  //tprintf("finish mark phase\n");
   // get large objects from all cores
   master_getlargeobjs();
-
+  //tprintf("start compact phase\n");
   // compact the heap
   master_compact();
-  
+  //tprintf("start update phase\n");
   // update the references
   master_updaterefs(stackptr);
-  GC_PRINTF("gc master finished update   \n");
+  //tprintf("gc master finished update   \n");
   // do cache adaptation
   CACHEADAPT_PHASE_MASTER();
-
+  //tprintf("finish cachdapt phase\n");
   // do finish up stuff
   master_finish();
 
-  GC_PRINTF("gc finished   \n");
-  tprintf("finish GC ! %d \n",gcflag);
+  //tprintf("finish GC ! %d \n",gcflag);
 } 
 
 void pregccheck() {
@@ -517,6 +521,7 @@ bool gc(struct garbagelist * stackptr) {
     pregcprocessing();
     gc_master(stackptr);
   } else if(BAMBOO_NUM_OF_CORE < NUMCORES4GC) {
+    GC_PRINTF("Core reporting for gc.\n");
     pregcprocessing();
     gc_collect(stackptr);
   } else {
@@ -524,7 +529,6 @@ bool gc(struct garbagelist * stackptr) {
     gc_nocollect(stackptr);
   }
   postgcprocessing();
-
   return true;
 } 
 
index bdbd70f8394fd0a27a5bd0b485ac195cdeadab1a..35e95e808e00347259c9d6589f55b04f254c1d9e 100644 (file)
 #define GC_PRINTF if(0) tprintf
 #endif 
 
+#ifdef GC_DEBUG
 #define TR() tprintf("%u\n",__LINE__)
+#else
+#define TR()
+#endif
 
 // data structures for GC
 #define BAMBOO_SMEM_SIZE_L (BAMBOO_SMEM_SIZE * 2)
index 301c9b503f6e6888d8d87e0ed09af31e7c31cc11..c581122962ff684db78d2dfc971153d3ba2ef224 100644 (file)
@@ -378,6 +378,7 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
       unsigned int length=ALIGNSIZETOBYTES(objlength);
 
       //code between this and next comment should be removed
+#ifdef GC_DEBUG
       unsigned int size;
       unsigned int type;
       gettype_size(origptr, &type, &size);
@@ -390,8 +391,8 @@ unsigned int compactblocks(struct moveHelper * orig, struct moveHelper * to) {
        unsigned INTPTR lobits=(alignsize&15)<<1;
        tprintf("hibits=%x lobits=%x\n", hibits, lobits);
        tprintf("hi=%x lo=%x\n", gcmarktbl[hibits], gcmarktbl[hibits+1]);
-       
       }
+#endif
       //end of code to remove
 
       void *endtoptr=toptr+length;
@@ -471,13 +472,11 @@ void master_compact() {
   // compact phase
   compact();
   /* wait for all cores to finish compacting */
-  tprintf("MASTER WAITING\n");
   
 
   while(!gc_checkCoreStatus())
     ;
 
-  tprintf("POST_WAIT\n");
   GCPROFILE_ITEM();
 
   //just in case we didn't get blocks back...
index 246325a1e1c62a20309738358e5ecf00a2c5840b..df4a978e508c9b28549b67d4e7d290710b70bc40 100644 (file)
@@ -28,7 +28,9 @@ extern struct lockvector bamboo_threadlocks;
 #define updateObj(objptr) gcmappingtbl[OBJMAPPINGINDEX(objptr)]
 //#define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) obj=updateObj(updatetmpptr);if (obj<gcbaseva) tprintf("BAD PTR %x to %x in %u\n", updatetmpptr, obj, __LINE__);}
 #define UPDATEOBJ(obj) {void *updatetmpptr=obj; if (updatetmpptr!=NULL) {obj=updateObj(updatetmpptr);}}
+
 //if (obj==NULL) tprintf("Mapping problem for object %x, mark=%u, line=%u\n", updatetmpptr, getMarkedLength(updatetmpptr),__LINE__);}}
+
 #define UPDATEOBJNONNULL(obj) {void *updatetmpptr=obj; obj=updateObj(updatetmpptr);}
 //if (updatetmpptr!=NULL&&obj==NULL) tprintf("Mapping parameter for object %x, mark=%u, line=%u\n", updatetmpptr, getMarkedLength(updatetmpptr),__LINE__);}
 
index a35a79322b16fb8d8d52eca42602aff4cc45b71e..b3407676fab50fa3d8c3a12c8ed95db38f5b2b68 100644 (file)
@@ -246,12 +246,16 @@ void mark(struct garbagelist * stackptr) {
       unsigned int iunits = ALIGNUNITS(size);
 
       //debugging for the next five lines
+#ifdef GC_DEBUG
       unsigned INTPTR alignsize=ALIGNOBJSIZE((unsigned INTPTR)(ptr-gcbaseva));
       unsigned INTPTR hibits=alignsize>>4;
       unsigned INTPTR lobits=(alignsize&15)<<1;
       unsigned INTPTR ohigh=gcmarktbl[hibits];
       unsigned INTPTR olow=gcmarktbl[hibits+1];
+#endif
       setLengthMarked(ptr,iunits);
+
+#ifdef GC_DEBUG
       unsigned int unit=getMarkedLength(ptr);
       if (unit!=iunits) {
        tprintf("Bad mark on %x %u!=%u\n", ptr, unit, iunits);
@@ -261,7 +265,7 @@ void mark(struct garbagelist * stackptr) {
        unsigned INTPTR nlow=gcmarktbl[hibits+1];
        tprintf("nhigh=%x nlow=%x", nhigh, nlow);
       }
-
+#endif
       if(islarge) {
         // ptr is a large object and not marked or enqueued
        printf("NEED TO SUPPORT LARGE OBJECTS!\n");
index f84ac4506ed3b6fc67d347c86db1cddbcd59aea8..cc82172bc9f8015e3ea3771f7613f077e0f5d43b 100644 (file)
@@ -98,8 +98,9 @@ void * smemalloc_I(int coren, int isize, int * allocsize) {
 #elif defined(SMEMG)
   void *mem = globalmalloc_I(coren, isize, allocsize);
 #endif
+
   if(mem == NULL) {
-    // no enough shared global memory
+    // not enough shared global memory
     // trigger gc
     if(!gcflag) {
       gcflag = true;