properly disable mem checkpointing when number of nodes is too few.
authorGengbin Zheng <gzheng@illinois.edu>
Sat, 9 Jan 2010 00:22:39 +0000 (18:22 -0600)
committerGitosis server account <gitosis@charm.cs.uiuc.edu>
Sat, 9 Jan 2010 00:22:39 +0000 (18:22 -0600)
via git-CVS emulator

src/ck-core/ckmemcheckpoint.C

index 7a6aade09f869936d00d1d0ff2e104f3ad774eba..49bf80b81e923ea38871d7f6cf3e838b994f6994 100644 (file)
@@ -263,12 +263,19 @@ public:
 
 CkMemCheckPT::CkMemCheckPT(int w)
 {
+  int numnodes = 0;
+#if NODE_CHECKPOINT
+  numnodes = CmiNumPhysicalNodes();
+#else
+  numnodes = CkNumPes();
+#endif
 #if CK_NO_PROC_POOL
-  if (CkNumPes() <= 2) {
+  if (numnodes <= 2)
 #else
-  if (CkNumPes()  == 1) {
+  if (numnodes  == 1)
 #endif
-    if (CkMyPe() == 0)  CkPrintf("Warning: CkMemCheckPT disabled!\n");
+  {
+    if (CkMyPe() == 0)  CkPrintf("Warning: CkMemCheckPT is disabled due to too few nodes.\n");
     _memChkptOn = 0;
   }
   inRestarting = 0;
@@ -769,7 +776,12 @@ void CkMemCheckPT::finishUp()
        CkStartQD(cpCallback);
   } 
 #if CK_NO_PROC_POOL
-  if (CkNumPes()-totalFailed() <=2) {
+#if NODE_CHECKPOINT
+  int numnodes = CmiNumPhysicalNodes();
+#else
+  int numnodes = CkNumPes();
+#endif
+  if (numnodes-totalFailed() <=2) {
     if (CkMyPe()==0) CkPrintf("Warning: CkMemCheckPT disabled!\n");
     _memChkptOn = 0;
   }