From: bdemsky Date: Tue, 21 Jun 2011 07:48:35 +0000 (+0000) Subject: changes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8f9258fe80f1d011cb4f87d6cc09231c43bef27d;p=IRC.git changes --- diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.h b/Robust/src/Runtime/bamboo/multicoregarbage.h index 94f8c183..2d95c3d6 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.h +++ b/Robust/src/Runtime/bamboo/multicoregarbage.h @@ -105,6 +105,7 @@ void * gcbaseva; // base va for shared memory without reserved sblocks static bool gc_checkCoreStatus() { for(int i = 0; i < NUMCORES4GC; i++) { if(gccorestatus[i]) { + printf("CHECK\n"); return false; } } diff --git a/Robust/src/Runtime/bamboo/multicoregccompact.c b/Robust/src/Runtime/bamboo/multicoregccompact.c index b7973372..b21410ba 100644 --- a/Robust/src/Runtime/bamboo/multicoregccompact.c +++ b/Robust/src/Runtime/bamboo/multicoregccompact.c @@ -335,7 +335,7 @@ void master_compact() { compact(); /* wait for all cores to finish compacting */ - while(gc_checkCoreStatus()) + while(!gc_checkCoreStatus()) ; GCPROFILE_ITEM(); diff --git a/Robust/src/Runtime/bamboo/multicoremem.h b/Robust/src/Runtime/bamboo/multicoremem.h index 2680fb4e..6297a687 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.h +++ b/Robust/src/Runtime/bamboo/multicoremem.h @@ -118,7 +118,7 @@ int bamboo_free_smem_size; //This flag indicates that a memory request was services volatile bool smemflag; //Pointer to new block of memory after request -volatile unsigned int * bamboo_cur_msp; +volatile void * bamboo_cur_msp; //Number of bytes in new block of memory volatile int bamboo_smem_size; diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.c b/Robust/src/Runtime/bamboo/multicoreruntime.c index 3d9ddb31..37a77257 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.c +++ b/Robust/src/Runtime/bamboo/multicoreruntime.c @@ -579,11 +579,10 @@ void abort_task() { } INLINE void initruntimedata() { - int i; // initialize the arrays if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { // startup core to initialize corestatus[] - for(i = 0; i < NUMCORESACTIVE; ++i) { + for(int i = 0; i < NUMCORESACTIVE; ++i) { corestatus[i] = 1; numsendobjs[i] = 0; numreceiveobjs[i] = 0; @@ -596,20 +595,23 @@ INLINE void initruntimedata() { self_numsendobjs = 0; self_numreceiveobjs = 0; - for(i = 0; i < BAMBOO_MSG_BUF_LENGTH; ++i) { + for(int i = 0; i < BAMBOO_MSG_BUF_LENGTH; ++i) { msgdata[i] = -1; } msgdataindex = 0; msgdatalast = 0; //msglength = BAMBOO_MSG_BUF_LENGTH; msgdatafull = false; - for(i = 0; i < BAMBOO_OUT_BUF_LENGTH; ++i) { + for(int i = 0; i < BAMBOO_OUT_BUF_LENGTH; ++i) { outmsgdata[i] = -1; } outmsgindex = 0; outmsglast = 0; outmsgleft = 0; isMsgHanging = false; + + + smemflag = true; bamboo_cur_msp = NULL; @@ -755,9 +757,6 @@ inline void run(int argc, char** argv) { // initialize runtime data structures initruntimedata(); - - // other architecture related initialization - initialization(); initCommunication(); CACHEADAPT_ENABLE_TIMER(); @@ -775,28 +774,28 @@ inline void run(int argc, char** argv) { #ifdef TASK /* Create queue of active tasks */ activetasks= genallocatehashtable((unsigned int (*)(void *)) &hashCodetpd, - (int (*)(void *,void *)) &comparetpd); - + (int (*)(void *,void *)) &comparetpd); + /* Process task information */ processtasks(); - + if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { /* Create startup object */ createstartupobject(argc, argv); } #endif - - if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { + + if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { #ifdef TASK - // run the initStaticAndGlobal method to initialize the static blocks and - // global fields - initStaticAndGlobal(); + // run the initStaticAndGlobal method to initialize the static blocks and + // global fields + initStaticAndGlobal(); #elif defined MGC - // run the main method in the specified mainclass - mgc_main(argc, argv); + // run the main method in the specified mainclass + mgc_main(argc, argv); #endif // TASK - } - + } + while(true) { GCCHECK(NULL); #ifdef TASK @@ -818,7 +817,7 @@ inline void run(int argc, char** argv) { sendStall = false; } #endif - + if(!tocontinue) { // check if stop if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { @@ -831,20 +830,20 @@ inline void run(int argc, char** argv) { #ifdef PROFILE if(!stall) { #endif - if(isfirst) { - // wait for some time - int halt = 10000; - while(halt--) { - } - isfirst = false; - } else { - // send StallMsg to startup core - // send stall msg - send_msg_4(STARTUPCORE,TRANSTALL,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs); - sendStall = true; - isfirst = true; - busystatus = false; - } + if(isfirst) { + // wait for some time + int halt = 10000; + while(halt--) { + } + isfirst = false; + } else { + // send StallMsg to startup core + // send stall msg + send_msg_4(STARTUPCORE,TRANSTALL,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs); + sendStall = true; + isfirst = true; + busystatus = false; + } #ifdef PROFILE } #endif @@ -856,6 +855,6 @@ inline void run(int argc, char** argv) { } } } -} - +} + #endif // MULTICORE diff --git a/Robust/src/Runtime/bamboo/multicoreruntime.h b/Robust/src/Runtime/bamboo/multicoreruntime.h index 31ba7d3c..c7d13b0c 100644 --- a/Robust/src/Runtime/bamboo/multicoreruntime.h +++ b/Robust/src/Runtime/bamboo/multicoreruntime.h @@ -65,7 +65,6 @@ int self_numreceiveobjs; // these are functions should be implemented in // // multicore runtime for any multicore processors // //////////////////////////////////////////////////////////// -INLINE void initialization(void); INLINE void initCommunication(void); INLINE void fakeExecution(void); INLINE void terminate(void);