Fixed the node group ckdirect version for the 1 processor case
authorSayantan Chakravorty <sayantan_chak@yahoo.com>
Wed, 9 Apr 2008 20:19:59 +0000 (20:19 +0000)
committerSayantan Chakravorty <sayantan_chak@yahoo.com>
Wed, 9 Apr 2008 20:19:59 +0000 (20:19 +0000)
tests/charm++/pingpong/pingpong.C
tests/charm++/pingpong/pingpong.ci

index d55790de35e132920a76a0126ee83d8c4f18d23e..e58a41973b5976094549604adfbec137c5c13599 100644 (file)
@@ -197,6 +197,7 @@ class PingN : public NodeGroup
 #endif
   double start_time, end_time;
 public:
+  CProxyElement_PingN *myProxy;
   PingN()
   {
     me = CkMyNode();    
@@ -207,10 +208,12 @@ public:
     // calculation.
 
     pp = new CProxyElement_PingN(thisgroup,nbr);
+    myProxy = new CProxyElement_PingN(thisgroup,me);
     niter = 0;
 #ifdef USE_RDMA 
     rbuff=(char *) malloc(payload*sizeof(char));
     sbuff=(char *) malloc(payload*sizeof(char));
+    bzero(sbuff,payload);
     // setup persistent comm sender and receiver side
     double OOB=9999999999.0;
     rhandle=CmiDirect_createHandle(nbr,rbuff,payload*sizeof(char),PingN::Wrapper_To_CallBack,(void *) this,OOB);
@@ -266,7 +269,11 @@ public:
     PingN* mySelf = (PingN*) pt2Object;
 
     // call member
-    mySelf->recvRDMA();
+    if(CkNumNodes() == 0){
+      mySelf->recvRDMA();
+    }else{
+      (*mySelf->myProxy).recvRDMA();   
+    }
   }
   // not an entry method, called via Wrapper_To_Callback
   void recvRDMA()
index 79b3d23145ab06b50c680705e59105bfa51cd9ea..8a1253ba99c00dbee7832efdd253661ab9a4a1db 100644 (file)
@@ -44,6 +44,7 @@ mainmodule pingpong {
     entry void start(void);
     entry void startRDMA(void);
     entry [exclusive] void recv(PingMsg *);
+    entry [exclusive] void recvRDMA();
     entry [exclusive] void recvHandle(char ptr[size], int size);
   }
   array [Fancy] PingF {