srcpe is used for two purpose, one for plain chare creation, another mainly by projec...
authorGengbin Zheng <gzheng@illinois.edu>
Sun, 18 Mar 2012 21:50:11 +0000 (14:50 -0700)
committerGengbin Zheng <gzheng@illinois.edu>
Sun, 18 Mar 2012 21:50:11 +0000 (14:50 -0700)
src/ck-core/ck.C
src/ck-core/envelope.h

index af82a3d93f53d0afd7cac6d159e936f360b5d1e1..add5df611488934ade9da61e5a11f84dec381f62 100644 (file)
@@ -662,6 +662,7 @@ void CkCreateChare(int cIdx, int eIdx, void *msg, CkChareID *pCid, int destPE)
 #endif
   }
   env->setEpIdx(eIdx);
+  env->setByPe(CkMyPe());
   env->setSrcPe(CkMyPe());
   CmiSetHandler(env, _charmHandlerIdx);
   _TRACE_CREATION_1(env);
@@ -921,7 +922,7 @@ static void _processNewVChareMsg(CkCoreState *ck,envelope *env)
   // pCid->magic = _GETIDX(_entryTable[env->getEpIdx()]->chareIdx);
   register envelope *ret = UsrToEnv(pCid);
   ret->setVidPtr(env->getVidPtr());
-  register int srcPe = env->getSrcPe();
+  register int srcPe = env->getByPe();
   ret->setSrcPe(CkMyPe());
   CmiSetHandler(ret, _charmHandlerIdx);
   CmiSyncSendAndFree(srcPe, ret->getTotalsize(), (char *)ret);
index 0135078a2e59535307f9cefb2dc5d3284f9854c9..d43652330f539a04cd66a7c55876158231769358 100644 (file)
@@ -149,6 +149,7 @@ public:
       struct s_chare {  // NewChareMsg, NewVChareMsg, ForChareMsg, ForVidMsg, FillVidMsg
         void *ptr;      ///< object pointer
         UInt forAnyPe;  ///< Used only by newChare
+        int  bype;      ///< created by this pe
       } chare;
       struct s_group {         // NodeBocInitMsg, BocInitMsg, ForNodeBocMsg, ForBocMsg
         CkGroupID g;           ///< GroupID
@@ -318,6 +319,14 @@ private:
     void   setObjPtr(void *p) { 
       CkAssert(getMsgtype()==ForChareMsg); type.chare.ptr = p; 
     }
+    UInt getByPe(void) { 
+      CkAssert(getMsgtype()==NewChareMsg || getMsgtype()==NewVChareMsg); 
+      return type.chare.bype; 
+    }
+    void setByPe(UInt pe) { 
+      CkAssert(getMsgtype()==NewChareMsg || getMsgtype()==NewVChareMsg); 
+      type.chare.bype = pe; 
+    }
 
 // Group-specific fields
     CkGroupID   getGroupNum(void) const {