added a variable higherLevel and a method deliverer to be used to uniform the
authorFilippo Gioachin <gioachin@illinois.edu>
Wed, 30 Jun 2004 23:47:36 +0000 (23:47 +0000)
committerFilippo Gioachin <gioachin@illinois.edu>
Wed, 30 Jun 2004 23:47:36 +0000 (23:47 +0000)
usage of charm and convers layers

src/conv-com/convcomlibmanager.C
src/conv-com/convcomlibstrategy.C
src/conv-com/convcomlibstrategy.h

index 524cc793a3378762e5f9ef5bab63005c3525a7a7..c32b0de0f7bcf749311f16b44b622616d4c3ab46 100644 (file)
@@ -55,7 +55,7 @@ void initComlibManager(){
     CkpvInitialize(ConvComlibManager *, conv_comm_ptr);
     CkpvAccess(conv_comm_ptr) = conv_com;
 
-    //comm_debug = 1;
+    comm_debug = 0;
     ComlibPrintf("Init Call\n");
 
     CkpvInitialize(int, RecvmsgHandle);
index 529f04fa96c12e79889d2c57e94d3f84a59b0791..a7caca3bbe167040c22dba82b299de2076ca519e 100644 (file)
@@ -13,6 +13,7 @@ Strategy::Strategy() : PUP::able() {
     myInstanceID = 0;
     type = CONVERSE_STRATEGY;
     converseStrategy = this;
+    higherLevel = this;
     isStrategyBracketed = 0;
 };
 
@@ -23,6 +24,11 @@ void Strategy::pup(PUP::er &p){
 
     p | isStrategyBracketed;
     p | type;
+
+    if (p.isUnpacking()) {
+      converseStrategy = this;
+      higherLevel = this;
+    }
 }
 
 //Message holder functions. Message holder is a wrapper around a
index a0d378a74298689ad0342cdedf82735c248e2c8b..38aab626bd9da1e5a1af01818ebfe84d5ccdfa38 100644 (file)
@@ -76,11 +76,13 @@ class Strategy : public PUP::able{
     //them.  For the code to work in both Charm and converse, this
     //variable can be used.    
     Strategy *converseStrategy;
+    Strategy *higherLevel;
 
  public:
     Strategy();
     Strategy(CkMigrateMessage *m) : PUP::able(m) {
         converseStrategy = this;
+       higherLevel = this;
     }
 
     void setBracketed(){isStrategyBracketed = 1;}
@@ -106,6 +108,19 @@ class Strategy : public PUP::able{
         return converseStrategy;
     }
 
+    void setHigherLevel(Strategy *s) {
+      higherLevel = s;
+    }
+
+    Strategy * getHigherLevel() {
+      return higherLevel;
+    }
+
+    //This method can be used to deliver a message through the correct class
+    //when converse does not know if the message was originally sent from
+    //converse itself of from a higher level language like charm
+    virtual void deliverer(char*) {CmiAbort("Strategy::deliverer: If used, should be first redefined\n");};
+
     //Each strategy must define his own Pup interface.
     virtual void pup(PUP::er &p);
     PUPable_decl(Strategy);