From: bdemsky Date: Tue, 19 Jul 2011 05:45:41 +0000 (+0000) Subject: fix code X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9fefd0e13ab775f67ffffc99487b40c7031fb072;p=IRC.git fix code --- diff --git a/Robust/src/Runtime/bamboo/multicorecache.c b/Robust/src/Runtime/bamboo/multicorecache.c index 27361491..6cbe2789 100644 --- a/Robust/src/Runtime/bamboo/multicorecache.c +++ b/Robust/src/Runtime/bamboo/multicorecache.c @@ -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 diff --git a/Robust/src/Runtime/bamboo/multicorecache.h b/Robust/src/Runtime/bamboo/multicorecache.h index 9312674b..26a26105 100644 --- a/Robust/src/Runtime/bamboo/multicorecache.h +++ b/Robust/src/Runtime/bamboo/multicorecache.h @@ -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()