Fix to the readonly delegated proxy workaround.
authorLukasz Wesolowski <wesolwsk@talent.cs.illinois.edu>
Fri, 9 Sep 2011 01:41:17 +0000 (20:41 -0500)
committerLukasz Wesolowski <wesolwsk@talent.cs.illinois.edu>
Fri, 9 Sep 2011 18:13:09 +0000 (13:13 -0500)
src/ck-core/ck.C

index 16f451144772353a3d771aa8599342ad1d690894..5def5a88f20c5e575b0cf187e30d9c399373e083 100644 (file)
@@ -344,23 +344,27 @@ void CProxy::pup(PUP::er &p) {
       delegatedMgr = ckDelegatedTo(); 
     }
 
-    // if delegated manager has not been created, construct a dummy
-    // object on which to call DelegatePointerPup
-    if (delegatedMgr == NULL) {
-
-      int migCtor; 
+    int migCtor, cIdx; 
+    if (!p.isUnpacking()) {
       if (isNodeGroup) {
         CmiImmediateLock(CksvAccess(_nodeGroupTableImmLock));
-        migCtor = 
-          CksvAccess(_nodeGroupTable)->find(delegatedGroupId).getmigCtor();
+        cIdx = CksvAccess(_nodeGroupTable)->find(delegatedGroupId).getcIdx(); 
+        migCtor = _chareTable[cIdx]->migCtor; 
         CmiImmediateUnlock(CksvAccess(_nodeGroupTableImmLock));
       }
       else  {
         CmiImmediateLock(CkpvAccess(_groupTableImmLock));
-        migCtor = 
-          CkpvAccess(_groupTable)->find(delegatedGroupId).getmigCtor();
+        cIdx = CkpvAccess(_groupTable)->find(delegatedGroupId).getcIdx();
+        migCtor = _chareTable[cIdx]->migCtor; 
         CmiImmediateUnlock(CkpvAccess(_groupTableImmLock));
-      } 
+      }         
+    }
+
+    p|migCtor;
+
+    // if delegated manager has not been created, construct a dummy
+    // object on which to call DelegatePointerPup
+    if (delegatedMgr == NULL) {
 
       // create a dummy object for calling DelegatePointerPup
       int objId = _entryTable[migCtor]->chareIdx;