do synchronization after message handlers are up
[IRC.git] / Robust / src / Runtime / bamboo / multicoreruntime.c
index 4d8e5f0e59d9037d4a991d69ed26784e2c51deb0..73835dd3556ee1f526cab7314ce2418dffc773d6 100644 (file)
@@ -753,13 +753,27 @@ inline void run(int argc, char** argv) {
   bool sendStall = false;
   bool isfirst = true;
   bool tocontinue = false;
-
+  startflag = false;
   corenum = BAMBOO_GET_NUM_OF_CORE();
 
   // initialize runtime data structures
   initruntimedata();
   initCommunication();
 
+  if (BAMBOO_NUM_OF_CORE==STARTUPCORE) {
+    numconfirm=NUMCORES-1;
+    for(int i=0;i<NUMCORES;i++) {
+      if (i!=STARTUPCORE) {
+       send_msg_1(STARTUPCORE,REQ_NOTIFY_START);
+      }
+    }
+    while(numconfirm!=0)
+      ;
+  } else {
+    while(!startflag)
+      ;
+  }
+
   CACHEADAPT_ENABLE_TIMER();
 
   initializeexithandler();