changes made to support for inmem checkpoint, each migratable object contains 2 buddies.
authorLixia Shi <lixiashi@uiuc.edu>
Fri, 19 Dec 2003 07:41:34 +0000 (07:41 +0000)
committerLixia Shi <lixiashi@uiuc.edu>
Fri, 19 Dec 2003 07:41:34 +0000 (07:41 +0000)
Changed to disable temporarily the array listeners during restarting. Most of these changes will not be necessary in the next version of mem checkpoint.

src/ck-core/ckarray.C
src/ck-core/ckarray.ci
src/ck-core/ckarray.h
src/ck-core/ckreduction.C

index 924d38ccf5010b8feb49c36671e7371b2d4734c9..fb73c11ae47f5e397c8831a63b57eb59450ecb34 100644 (file)
@@ -190,6 +190,10 @@ void ArrayElement::initBasics(void)
 ArrayElement::ArrayElement(void) 
 {
        initBasics();
+#if CMK_MEM_CHECKPOINT
+        init_checkpt();
+#endif
+
 }
 ArrayElement::ArrayElement(CkMigrateMessage *m) 
 {
@@ -238,6 +242,9 @@ void ArrayElement::pup(PUP::er &p)
   if (p.isUnpacking())
        thisArray=thisArrayID.ckLocalBranch();
   p(listenerData,CK_ARRAYLISTENER_MAXLEN);
+#if CMK_MEM_CHECKPOINT
+  p(budPEs, 2);
+#endif
 }
 
 /// A more verbose form of abort
index e76d8e4e93cfa844d1b0ecaa7a3d81fa74018a28..2e7841bda441b305e4376e928a05f29eca13f789 100644 (file)
@@ -25,6 +25,8 @@ module CkArray {
     entry ArrayElement();
     //Calls destructor:
     entry void ckDestroy(void);
+    // CMK_MEM_CHECKPOINT
+    entry void inmem_checkpoint(CkArrayCheckPTReqMessage *);
   };
 
 
index 8c81b35d0835de79b003fd025b9efea529a33cb1..fd53eb29a6759ac691d6cd56040e6f281607782f 100644 (file)
@@ -407,6 +407,16 @@ private:
 # define CK_ARRAYLISTENER_MAXLEN 3
 #endif
   int listenerData[CK_ARRAYLISTENER_MAXLEN];
+
+#if CMK_MEM_CHECKPOINT
+friend class CkMemCheckPT;
+protected:
+  int budPEs[2];
+private:
+  void init_checkpt();
+#endif
+public:
+  void inmem_checkpoint(CkArrayCheckPTReqMessage *m);
 };
 inline int *CkArrayListener::ckGetData(ArrayElement *el) const
   {return &el->listenerData[dataOffset];}
@@ -626,8 +636,7 @@ private:
   CkArrayReducer *reducer; //Read-only copy of default reducer
   CkArrayBroadcaster *broadcaster; //Read-only copy of default broadcaster
 public:
-  int isCkArray() { return 1; }
-  void flushStates() { CK_ARRAYLISTENER_LOOP(listeners, l->flushState()); }
+  void flushStates() { CkReductionMgr::flushStates(); CK_ARRAYLISTENER_LOOP(listeners, l->flushState()); }
 };
 /*@}*/
 
index 1850a51c5c53af2ccb518190dd28c4066314c7fa..da908daab203dccdc20442017c01a91a8adf27ec 100644 (file)
@@ -269,6 +269,10 @@ far into the future.  The adj() vector is what saves us here.
 */
 void CkReductionMgr::contributorDied(contributorInfo *ci)
 {
+#if CMK_MEM_CHECKPOINT
+  // ignore from listener if it is during restart from crash
+  if (CkInRestarting()) return;
+#endif
   DEBR((AA"Contributor %p(%d) died\n"AB,ci,ci->redNo));
   //We lost a contributor
   gcount--;