From c5f01256c21ed3124eaea1f64752ec93539eb42e Mon Sep 17 00:00:00 2001 From: jzhou Date: Thu, 18 Mar 2010 22:15:37 +0000 Subject: [PATCH] bug fix in multicore Bamboo, TILERZ_LINUX mode now works for 56 cores --- Robust/src/Runtime/multicoreruntime.h | 5 +++-- Robust/src/Runtime/multicoretask.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Robust/src/Runtime/multicoreruntime.h b/Robust/src/Runtime/multicoreruntime.h index e9a44c61..d8be4b5c 100644 --- a/Robust/src/Runtime/multicoreruntime.h +++ b/Robust/src/Runtime/multicoreruntime.h @@ -494,8 +494,9 @@ void outputProfileData(); // BAMBOO_COORDS(c, x, y): convert the cpu # to coords (*x, *y) // // BAMBOO_DEBUGPRINT(x): print out integer x // // BAMBOO_DEBUGPRINT_REG(x): print out value of variable x // -// BAMBOO_EXIT(x): exit routine // -// BAMBOO_DIE(x): error exit routine // +// BAMBOO_EXIT_APP(x): exit the whole application // +// BAMBOO_EXIT(x): error exit routine with error # // +// BAMBOO_DIE(x): error exit routine with error msg // // BAMBOO_GET_EXE_TIME(): rountine to get current clock cycle number // // BAMBOO_MSG_AVAIL(): checking if there are msgs coming in // // BAMBOO_GCMSG_AVAIL(): checking if there are gcmsgs coming in // diff --git a/Robust/src/Runtime/multicoretask.c b/Robust/src/Runtime/multicoretask.c index aaa092c3..5e8281f6 100644 --- a/Robust/src/Runtime/multicoretask.c +++ b/Robust/src/Runtime/multicoretask.c @@ -390,13 +390,15 @@ void checkCoreStatus() { BAMBOO_DEBUGPRINT(0xee05); #endif corestatus[BAMBOO_NUM_OF_CORE] = 1; + waitconfirm = true; + numconfirm = NUMCORESACTIVE - 1; + BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); for(i = 1; i < NUMCORESACTIVE; ++i) { corestatus[i] = 1; // send status confirm msg to core i send_msg_1(i, STATUSCONFIRM); } // for(i = 1; i < NUMCORESACTIVE; ++i) - waitconfirm = true; - numconfirm = NUMCORESACTIVE - 1; + return; } else { // all the core status info are the latest // terminate; for profiling mode, send request to all @@ -455,6 +457,7 @@ void checkCoreStatus() { while(halt--) { } } else { + BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); break; } // if(!allStall) } // while(true) @@ -467,6 +470,7 @@ void checkCoreStatus() { #endif // #ifdef GC_PROFILE #endif // #ifdef MULTICORE_GC disruntimedata(); + BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME(); terminate(); // All done. } // if(!waitconfirm) } else { @@ -1895,8 +1899,8 @@ INLINE void processmsg_statusconfirm_I() { // cache the msg first //if(isMsgSending) { cache_msg_5(STARTUPCORE, STATUSREPORT, - busystatus?1:0, BAMBOO_NUM_OF_CORE, - self_numsendobjs, self_numreceiveobjs); + busystatus?1:0, BAMBOO_NUM_OF_CORE, + self_numsendobjs, self_numreceiveobjs); /*} else { send_msg_5(STARTUPCORE, STATUSREPORT, busystatus?1:0, BAMBOO_NUM_OF_CORE, self_numsendobjs, @@ -1943,7 +1947,7 @@ INLINE void processmsg_terminate_I() { #endif #endif disruntimedata(); - BAMBOO_EXIT(0); + BAMBOO_EXIT_APP(0); } INLINE void processmsg_memrequest_I() { -- 2.34.1