ProxyPatch.h

Go to the documentation of this file.
00001 
00007 #ifndef PROXYPATCH_H
00008 #define PROXYPATCH_H
00009 
00010 #include "Patch.h"
00011 
00012 class ProxyDataMsg;
00013 //class ProxyAllMsg;
00014 
00015 #define PROXYMSGNOTBUFFERED 0
00016 #define PROXYDATAMSGBUFFERED 1
00017 #define PROXYALLMSGBUFFERED 2
00018 
00019 class ProxyPatch : public Patch
00020 {
00021   public:
00022 
00023      ProxyPatch(PatchID pd);
00024      virtual ~ProxyPatch(void);
00025 
00026      void receiveData(ProxyDataMsg*);
00027      void receiveAll(ProxyDataMsg*);
00028      //include gbis phase 1 data with std message
00029      void receiveData(ProxyGBISP2DataMsg*);//receive P1 results; begin P2
00030      void receiveData(ProxyGBISP3DataMsg*);//receive P2 results; begin P3
00031 
00032      void setSpanningTree(int, int*, int);
00033      int  getSpanningTreeParent() { return parent; }
00034      int  getSpanningTreeChild(int *);
00035      const int *getSpanningTreeChildPtr() { return child; }
00036      inline int getSpanningTreeNChild(void) { return nChild; }
00037 
00038     #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00039      void setSTNodeChildren(int numNids, int *nids);
00040      int *getSTNodeChildPtr() { return nodeChildren; }
00041      int getSTNNodeChild() { return numNodeChild; }
00042      #endif
00043 
00044      ProxyCombinedResultMsg *depositCombinedResultMsg(ProxyCombinedResultMsg *);
00045          ProxyCombinedResultMsg *depositCombinedResultRawMsg(ProxyCombinedResultRawMsg *);
00046 
00047 #if CMK_PERSISTENT_COMM
00048   private:
00049      PersistentHandle localphs;
00050      PersistentHandle *treephs;
00051      int               ntreephs;
00052   public:
00053      PersistentHandle *getSpanningTreePhs(int &n) { n = ntreephs; return treephs; }
00054 #endif
00055   protected:
00056 
00057      virtual void boxClosed(int);
00058 
00059   private:
00060 
00061      void sendResults(void);
00062 
00063      //"proxyMsgBufferStatus" indicates whether there's a ProxyDataMsg buffered
00064      // and waiting to be processed, while "curProxyMsg" points to 
00065      // the actual msg. This msg will be freed at the next step. --Chao Mei  
00066      int proxyMsgBufferStatus;
00067      ProxyDataMsg* curProxyMsg;
00068      ProxyDataMsg* prevProxyMsg;
00069 
00070      // for spanning tree
00071      ProxyCombinedResultMsg *msgCBuffer;
00072      int parent;
00073 //#ifdef NODEAWARE_PROXY_SPANNINGTREE
00074      /* Moved to Patch.h */
00075      //int *children;
00076      //int numChild;
00077 //#else
00078      /* Moved to Patch.h */
00079      //int *child; // spanning tree for recvResults()
00080      //int nChild;
00081 //#endif
00082      int nWait;
00083      
00084 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00085     CmiNodeLock depositLock;
00086 #endif     
00087 };
00088 
00089 
00090 #endif
00091 

Generated on Sat Nov 18 01:17:15 2017 for NAMD by  doxygen 1.4.7