00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CKCHECKPOINT_H
00027 #define _CKCHECKPOINT_H
00028
00029 #include <pup.h>
00030 #include <ckcallback.h>
00031 #include <ckmessage.h>
00032 #include "CkCheckpointStatus.decl.h"
00033
00034
00035 #define CKLOCMGR_LOOP(code) \
00036 for(i=0;i<numGroups;i++) { \
00037 IrrGroup *obj = CkpvAccess(_groupTable)->find((*CkpvAccess(_groupIDTable))[i]).getObj(); \
00038 if(obj && obj->isLocMgr()) { \
00039 CkLocMgr *mgr = (CkLocMgr*)obj; \
00040 code \
00041 } \
00042 }
00043
00044
00045 void CkPupROData(PUP::er &p);
00046 void CkPupMainChareData(PUP::er &p, CkArgMsg *args);
00047 void CkPupChareData(PUP::er &p);
00048 #if (defined(_FAULT_MLOG_) || defined(_FAULT_CAUSAL_))
00049 void CkPupGroupData(PUP::er &p,bool create=true);
00050 void CkPupNodeGroupData(PUP::er &p,bool create=true);
00051 #else
00052 void CkPupGroupData(PUP::er &p);
00053 void CkPupNodeGroupData(PUP::er &p);
00054 #endif
00055 void CkPupArrayElementsData(PUP::er &p, int notifyListeners=1);
00056 void CkPupProcessorData(PUP::er &p);
00057 void CkRemoveArrayElements();
00058
00059
00060 void CkStartCheckpoint(const char* dirname,const CkCallback& cb, bool requestStatus = false);
00061 void CkRestartMain(const char* dirname, CkArgMsg *args);
00062 #if CMK_SHRINK_EXPAND
00063 void CkResumeRestartMain(char *msg);
00064 #endif
00065 #if __FAULT__
00066 int CkCountArrayElements();
00067 #endif
00068
00069 #if CMK_SHRINK_EXPAND
00070 enum realloc_state : uint8_t { NO_REALLOC=0, REALLOC_MSG_RECEIVED=1, REALLOC_IN_PROGRESS=2 };
00071 extern realloc_state pending_realloc_state;
00072 extern CkGroupID _lbdb;
00073 #endif
00074
00075
00076 extern bool _inrestart;
00077 extern bool _restarted;
00078 extern int _oldNumPes;
00079 extern bool _chareRestored;
00080
00081 enum{CK_CHECKPOINT_SUCCESS, CK_CHECKPOINT_FAILURE};
00082
00083 class CkCheckpointStatusMsg:public CMessage_CkCheckpointStatusMsg{
00084 public:
00085 int status;
00086 CkCheckpointStatusMsg(int _status): status(_status){}
00087 };
00088
00089 #endif //_CKCHECKPOINT_H