fix code
authorbdemsky <bdemsky>
Tue, 19 Jul 2011 05:45:41 +0000 (05:45 +0000)
committerbdemsky <bdemsky>
Tue, 19 Jul 2011 05:45:41 +0000 (05:45 +0000)
Robust/src/Runtime/bamboo/multicorecache.c
Robust/src/Runtime/bamboo/multicorecache.h

index 27361491d486b6f12cc3bdd308979e2aee2d4eb0..6cbe2789e17fd33f5eb88d1846cc0bdaf0b0b50a 100644 (file)
@@ -280,18 +280,19 @@ unsigned int cacheAdapt_decision(int coren) {
   // check the statistic data
   // for each page, decide the new cache strategy
 #ifdef GC_CACHE_ADAPT_POLICY1
-  cacheAdapt_policy_h4h(coren);
-#elif defined GC_CACHE_ADAPT_POLICY2
-  cacheAdapt_policy_local(coren);
-#elif defined GC_CACHE_ADAPT_POLICY3
-  cacheAdapt_policy_hottest(coren);
-#elif defined GC_CACHE_ADAPT_POLICY4
+  //  cacheAdapt_policy_h4h(coren);
+#elif defined(GC_CACHE_ADAPT_POLICY2)
+  //cacheAdapt_policy_local(coren);
+#elif defined(GC_CACHE_ADAPT_POLICY3)
+  //cacheAdapt_policy_hottest(coren);
+#elif defined(GC_CACHE_ADAPT_POLICY4)
   cacheAdapt_policy_dominate(coren);
 #endif
 }
 
 // adapt the cache strategy for the mutator
 void cacheAdapt_mutator() {
+#if defined(GC_CACHE_ADAPT_POLICY4)
   BAMBOO_CACHE_MF();
   // check the changes and adapt them
   unsigned int * tmp_p = gccachepolicytbl;
@@ -305,6 +306,7 @@ void cacheAdapt_mutator() {
     }
     tmp_p += 1;
   }
+#endif
 }
 
 // Cache adapt phase process for clients
@@ -324,12 +326,15 @@ void cacheAdapt_phase_client() {
   //send init finish msg to core coordinator
   send_msg_2(STARTUPCORE, GCFINISHPREF, BAMBOO_NUM_OF_CORE);
   GC_PRINTF("Finish prefinish phase\n");
+
+#if defined(GC_CACHE_ADAPT_POLICY4)
   CACHEADAPT_SAMPLING_RESET();
   if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
     // zero out the gccachesamplingtbl
     BAMBOO_MEMSET_WH(gccachesamplingtbl_local,0,size_cachesamplingtbl_local);  
     BAMBOO_MEMSET_WH(gccachesamplingtbl_local_r,0,size_cachesamplingtbl_local_r);
   }
+#endif
 }
 
 extern unsigned long long gc_output_cache_policy_time;
@@ -360,6 +365,7 @@ void cacheAdapt_phase_master() {
   cacheAdapt_gc(false);
   GC_CHECK_ALL_CORE_STATUS();
   
+#if defined(GC_CACHE_ADAPT_POLICY4)
   CACHEADAPT_SAMPLING_RESET();
   if(BAMBOO_NUM_OF_CORE < NUMCORESACTIVE) {
     // zero out the gccachesamplingtbl
@@ -367,6 +373,7 @@ void cacheAdapt_phase_master() {
     BAMBOO_MEMSET_WH(gccachesamplingtbl_local_r,0,size_cachesamplingtbl_local_r);
     BAMBOO_MEMSET_WH(gccachepolicytbl,0,size_cachepolicytbl);
   }
+#endif
 }
 
 // output original cache sampling data for each page
index 9312674ba3f55260714ef2d77fd74e6dc3f5f7c4..26a26105bdf6314950bf883f8c327ff6a14c7e38 100644 (file)
@@ -69,9 +69,15 @@ void gc_output_cache_sampling_r();
 #define CACHEADAPT_SAMPLING_RESET() 
 #endif
 
+#if defined(GC_CACHE_ADAPT_POLICY4)
 #define CACHEADAPT_FINISH_SRC_PAGE(a,b,c) cacheadapt_finish_src_page(a,b,c);
 #define CACHEADAPT_FINISH_DST_PAGE(a,b,c,d) cacheadapt_finish_dst_page(a,b,c,d);
 #define CACHEADAPT_FINISH_COMPACT(a) cacheadapt_finish_compact(a);
+#else
+#define CACHEADAPT_FINISH_SRC_PAGE(a,b,c)
+#define CACHEADAPT_FINISH_DST_PAGE(a,b,c,d)
+#define CACHEADAPT_FINISH_COMPACT(a)
+#endif
 
 #define CACHEADAPT_GC(b) cacheAdapt_gc(b)
 #define CACHEADAPT_MASTER() cacheAdapt_master()