added a few functionalities to commlib
authorFilippo Gioachin <gioachin@illinois.edu>
Thu, 21 Jul 2005 01:42:04 +0000 (01:42 +0000)
committerFilippo Gioachin <gioachin@illinois.edu>
Thu, 21 Jul 2005 01:42:04 +0000 (01:42 +0000)
src/ck-com/ComlibManager.C
src/ck-com/ComlibManager.h
src/ck-com/ComlibStrategy.C

index 4acc975e468e443cd1fdff0facaed842b8af8c7a..4d54cd14588d9009a10a6c6cd06ff555ddc7443d 100644 (file)
@@ -965,12 +965,16 @@ CkDelegateData * ComlibManager::DelegatePointerPup(PUP::er &p,
     return inst;
 }    
 
-
 void ComlibDelegateProxy(CProxy *proxy){
     CProxy_ComlibManager cgproxy(CkpvAccess(cmgrID));
     proxy->ckDelegate(cgproxy.ckLocalBranch(), NULL);
 }
 
+void ComlibAssociateProxy(ComlibInstanceHandle *cinst, CProxy &proxy) {
+    CProxy_ComlibManager cgproxy(CkpvAccess(cmgrID));
+    proxy.ckDelegate(cgproxy.ckLocalBranch(), cinst);
+}
+
 void ComlibAssociateProxy(CharmStrategy *strat, CProxy &proxy) {
     ComlibInstanceHandle *cinst = new ComlibInstanceHandle
         (CkGetComlibInstance());
@@ -981,6 +985,12 @@ void ComlibAssociateProxy(CharmStrategy *strat, CProxy &proxy) {
     proxy.ckDelegate(cgproxy.ckLocalBranch(), cinst);
 } 
 
+ComlibInstanceHandle ComlibRegister(CharmStrategy *strat) {
+    ComlibInstanceHandle cinst(CkGetComlibInstance());
+    cinst.setStrategy(strat);
+    return cinst;
+}
+
 void ComlibBegin(CProxy &proxy) {
     ComlibInstanceHandle *cinst = (ComlibInstanceHandle *)proxy.ckDelegatedPtr();
     cinst->beginIteration();
index e9215382488da5aab0ad08fdd35eb84fb7f124a3..4967c824eb6e42f631de6fb1d1e902b527499fb1 100644 (file)
@@ -261,7 +261,9 @@ class ComlibManager: public CkDelegateMgr {
 };
 
 void ComlibDelegateProxy(CProxy *proxy);
+void ComlibAssociateProxy(ComlibInstanceHandle *cinst, CProxy &proxy);
 void ComlibAssociateProxy(CharmStrategy *strat, CProxy &proxy); 
+ComlibInstanceHandle ComlibRegister(CharmStrategy *strat);
 void ComlibBegin(CProxy &proxy);    
 void ComlibEnd(CProxy &proxy);    
 
index bd6d2e991f4ad282cf6c5512705d3f6c0bbcfd7a..8326829124d193a6a200de4d9e75c093a2a46919 100644 (file)
@@ -551,6 +551,7 @@ int ComlibGetLastKnown(CkArrayID aid, CkArrayIndexMax idx) {
         CkArray *array = CkArrayID::CkLocalBranch(aid);
         pe = array->lastKnown(idx) + CkNumPes();
         CkpvAccess(locationTable)->put(cidx) = pe;
+       //CkPrintf("LAST KNOWN %d: (%d %d %d %d) -> %d\n",CkMyPe(),((short*)&idx)[2],((short*)&idx)[3],((short*)&idx)[4],((short*)&idx)[5],pe);
     }
     //CkPrintf("last pe = %d \n", pe - CkNumPes());