moved idle event registration to common code
authorYanhuaSun <sun51@illinois.edu>
Sun, 24 Mar 2013 23:13:34 +0000 (18:13 -0500)
committerYanhuaSun <sun51@illinois.edu>
Sun, 24 Mar 2013 23:13:34 +0000 (18:13 -0500)
src/arch/bluegenep/machine.c
src/arch/gemini_gni/machine.c
src/arch/mpi/machine.c
src/arch/pamilrts/machine.c
src/arch/util/machine-common-core.c

index ab0aced2e03473f4815603658774a6481f57165d..c8d1279ae6630b135a19a238cef54b355fdfb338 100644 (file)
@@ -861,10 +861,6 @@ static void MachinePreCommonInitForDCMF(int everReturn) {
 }
 
 static void MachinePostCommonInitForDCMF(int everReturn) {
-#if !CMK_SMP || CMK_SMP_NO_COMMTHD
-    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyIdle,NULL);
-#endif
-
     CmiBarrier();
 }
 /* ######End of functions related with starting programs###### */
index 652bb89285902def4169428829f0bea2e0169ff8..2259cf43eacd8538dd4e93628528b5bf9de70177 100644 (file)
@@ -1914,12 +1914,7 @@ void LrtsPostCommonInit(int everReturn)
     }
 #endif
 
-#if CMK_SMP
-    CmiIdleState *s=CmiNotifyGetState();
-    CcdCallOnConditionKeep(CcdPROCESSOR_BEGIN_IDLE,(CcdVoidFn)CmiNotifyBeginIdle,(void *)s);
-    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyStillIdle,(void *)s);
-#else
-    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyStillIdle,NULL);
+#if !CMK_SMP
     if (useDynamicSMSG)
     CcdCallOnConditionKeep(CcdPERIODIC_10ms, (CcdVoidFn) PumpDatagramConnection, NULL);
 #endif
index ca54420e169f0a895f9eabd3e9dcc827096bc90f..99a4f1707e1e451c083b9c4bc248fa3b8381d598 100644 (file)
@@ -1658,7 +1658,6 @@ void LrtsPreCommonInit(int everReturn) {
 
 void LrtsPostCommonInit(int everReturn) {
 
-    CmiIdleState *s=CmiNotifyGetState();
 
     CpvInitialize(SMSG_LIST *, sent_msgs);
     CpvInitialize(SMSG_LIST *, end_sent);
@@ -1677,15 +1676,6 @@ void LrtsPostCommonInit(int everReturn) {
     }
 #endif
 
-#if CMK_SMP
-    CcdCallOnConditionKeep(CcdPROCESSOR_BEGIN_IDLE,(CcdVoidFn)CmiNotifyBeginIdle,(void *)s);
-    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyStillIdle,(void *)s);
-    if (Cmi_smp_mode_setting == COMM_THREAD_ONLY_RECV)
-      CcdCallOnConditionKeep(CcdPERIODIC,(CcdVoidFn)LrtsPostNonLocal,NULL);
-#else
-    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyIdleForMPI,NULL);
-#endif
-
 }
 /* ######End of functions related with starting programs###### */
 
index a38ed88cb819fa5fbc4608776c6418ab6f98d270..e7130bb1750d4856417127bed65a18c6568bad8f 100644 (file)
@@ -659,8 +659,6 @@ void LrtsPreCommonInit(int everReturn)
 
 void LrtsPostCommonInit(int everReturn)
 {
-  CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyIdle,NULL);
-
   //printf ("before calling CmiBarrier() \n");
   CmiBarrier();
 }
index cb43edf14835f757e6282fac69e4b6bbdaaa6bcf..b7fe70c32c1e865420ce4b2ceae1fbe083eea7b9 100644 (file)
@@ -931,6 +931,17 @@ static void ConverseRunPE(int everReturn) {
     CpvAccess(networkProgressCount) = 0;
 
     ConverseCommonInit(CmiMyArgv);
+    
+    // register idle events
+
+#if CMK_SMP
+    CmiIdleState *sidle=CmiNotifyGetState();
+    CcdCallOnConditionKeep(CcdPROCESSOR_BEGIN_IDLE,(CcdVoidFn)CmiNotifyBeginIdle,(void *)sidle);
+    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyStillIdle,(void *)sidle);
+#else
+    CcdCallOnConditionKeep(CcdPROCESSOR_STILL_IDLE,(CcdVoidFn)CmiNotifyStillIdle, NULL);
+#endif
+
 
     LrtsPostCommonInit(everReturn);