adding a hook to get a strategy pointer in the user program from the instancehandle
authorSameer Kumar <skumar2@uiuc.edu>
Fri, 24 Sep 2004 21:45:27 +0000 (21:45 +0000)
committerSameer Kumar <skumar2@uiuc.edu>
Fri, 24 Sep 2004 21:45:27 +0000 (21:45 +0000)
src/ck-com/ComlibManager.C
src/ck-com/ComlibManager.h
src/ck-com/PrioStreaming.h

index bddf327d8e259fc691a2b37d5b5cbf7691d4265f..91b9e98ebbfd0ed9c69940f9d347ae1a56fde75f 100644 (file)
@@ -806,13 +806,21 @@ void ComlibInstanceHandle::setStrategy(CharmStrategy *s) {
     (cgproxy.ckLocalBranch())->registerStrategy(_instid, s);
 }
 
     (cgproxy.ckLocalBranch())->registerStrategy(_instid, s);
 }
 
+CharmStrategy *ComlibInstanceHandle::getStrategy() {
+    if(_instid < 0) 
+        return NULL;    
+    
+    CProxy_ComlibManager cgproxy(_dmid);
+    return (cgproxy.ckLocalBranch())->getStrategy(_instid);
+}
+
 CkGroupID ComlibInstanceHandle::getComlibManagerID() {return _dmid;}    
 
 void ComlibInitSectionID(CkSectionID &sid){
 CkGroupID ComlibInstanceHandle::getComlibManagerID() {return _dmid;}    
 
 void ComlibInitSectionID(CkSectionID &sid){
-
+    
     sid._cookie.type = COMLIB_MULTICAST_MESSAGE;
     sid._cookie.pe = CkMyPe();
     sid._cookie.type = COMLIB_MULTICAST_MESSAGE;
     sid._cookie.pe = CkMyPe();
-
+    
     sid._cookie.sInfo.cInfo.id = 0;    
     sid.npes = 0;
     sid.pelist = NULL;
     sid._cookie.sInfo.cInfo.id = 0;    
     sid.npes = 0;
     sid.pelist = NULL;
index 39547d63c9aa988b063f624d22f38576461d83c1..a068466d6550f8144336d3450cb3914ea91b6089 100644 (file)
@@ -80,7 +80,7 @@ class ComlibInstanceHandle {
     
     CkGroupID getComlibManagerID();
     void setStrategy(CharmStrategy *);
     
     CkGroupID getComlibManagerID();
     void setStrategy(CharmStrategy *);
-
+    CharmStrategy *getStrategy();        
     int getSourcePe() {return _srcPe;}
 
     friend class ComlibManager;
     int getSourcePe() {return _srcPe;}
 
     friend class ComlibManager;
index 3f310cc160cb8aa3607bbc8274d242474067e5ca..7ac39406f17e19889ebdf7ea4d0358f604cca460 100644 (file)
@@ -1,5 +1,7 @@
+
 #ifndef PRIO_STREAMING
 #define PRIO_STREAMING
 #ifndef PRIO_STREAMING
 #define PRIO_STREAMING
+
 #include "ComlibManager.h"
 #include "StreamingStrategy.h"
 
 #include "ComlibManager.h"
 #include "StreamingStrategy.h"
 
@@ -29,6 +31,10 @@ class PrioStreaming : public StreamingStrategy {
     
     virtual void insertMessage(CharmMessageHolder *msg);
 
     
     virtual void insertMessage(CharmMessageHolder *msg);
 
+    inline void setBasePriority(int p) {
+        basePriority = p;
+    }
+
     virtual void pup(PUP::er &p);
     PUPable_decl(PrioStreaming);
 };
     virtual void pup(PUP::er &p);
     PUPable_decl(PrioStreaming);
 };