changes to make smp restart work
[charm.git] / src / conv-core / converse.h
index 88e6c7ef2ca2570f97e90769af86d88e52f2d573..10a643fc3a6abcb2e1ab107d987e087ed1b8d9ae 100644 (file)
@@ -608,22 +608,22 @@ extern void CmiNumberHandlerEx(int n, CmiHandlerEx h,void *userPtr);
 #define CmiGetHandlerFunction(env) (CmiHandlerToFunction(CmiGetHandler(env)))
 
 #if __FAULT__
-extern int cur_restart_phase;      /* number of restarts */
+CpvExtern(int, _curRestartPhase);      /* number of restarts */
 #endif
 
 #if CMK_MEM_CHECKPOINT
 #undef CmiSetHandler
-#define CmiSetHandler(m,v)  do {(((CmiMsgHeaderExt*)m)->hdl)=(v); (((CmiMsgHeaderExt*)m)->pn)=cur_restart_phase;} while(0)
+#define CmiSetHandler(m,v)  do {(((CmiMsgHeaderExt*)m)->hdl)=(v); (((CmiMsgHeaderExt*)m)->pn)=CpvAccess(_curRestartPhase);} while(0)
 #define MESSAGE_PHASE_CHECK(msg)       \
        {       \
           int phase = CmiGetRestartPhase(msg); \
-         if (phase != 9999 && phase < cur_restart_phase) {     \
+         if (phase != 9999 && phase < CpvAccess(_curRestartPhase)) {   \
             /* CmiPrintf("[%d] discard message of phase %d cur_restart_phase:%d. \n", CmiMyPe(), phase, cur_restart_phase); */ \
             CmiFree(msg);      \
            return;     \
           }    \
           /* CmiAssert(phase == cur_restart_phase || phase == 9999); */ \
-          if (phase > cur_restart_phase && phase != 9999) {    \
+          if (phase > CpvAccess(_curRestartPhase) && phase != 9999) {    \
             /* CmiPrintf("[%d] enqueue message of phase %d cur_restart_phase:%d. \n", CmiMyPe(), phase, cur_restart_phase); */ \
             CsdEnqueueFifo(msg);    \
            return;     \