NAMD
ProxyPatch.h
Go to the documentation of this file.
1 
7 #ifndef PROXYPATCH_H
8 #define PROXYPATCH_H
9 
10 #include "Patch.h"
11 
12 class ProxyDataMsg;
13 //class ProxyAllMsg;
14 
15 #define PROXYMSGNOTBUFFERED 0
16 #define PROXYDATAMSGBUFFERED 1
17 #define PROXYALLMSGBUFFERED 2
18 
19 class ProxyPatch : public Patch
20 {
21  public:
22 
23  ProxyPatch(PatchID pd);
24  virtual ~ProxyPatch(void);
25 
27  void receiveAll(ProxyDataMsg*);
28  //include gbis phase 1 data with std message
29  void receiveData(ProxyGBISP2DataMsg*);//receive P1 results; begin P2
30  void receiveData(ProxyGBISP3DataMsg*);//receive P2 results; begin P3
31 
32  void setSpanningTree(int, int*, int);
33  int getSpanningTreeParent() { return parent; }
34  int getSpanningTreeChild(int *);
35  const int *getSpanningTreeChildPtr() { return child; }
36  inline int getSpanningTreeNChild(void) { return nChild; }
37 
38  #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
39  void setSTNodeChildren(int numNids, int *nids);
40  int *getSTNodeChildPtr() { return nodeChildren; }
41  int getSTNNodeChild() { return numNodeChild; }
42  #endif
43 
46 
47 #if CMK_PERSISTENT_COMM
48  private:
49  PersistentHandle localphs;
50  PersistentHandle *treephs;
51  int ntreephs;
52  public:
53  PersistentHandle *getSpanningTreePhs(int &n) { n = ntreephs; return treephs; }
54 #endif
55  protected:
56 
57  virtual void boxClosed(int);
58 
59  private:
60 
61  void sendResults(void);
62 
63  //"proxyMsgBufferStatus" indicates whether there's a ProxyDataMsg buffered
64  // and waiting to be processed, while "curProxyMsg" points to
65  // the actual msg. This msg will be freed at the next step. --Chao Mei
66  int proxyMsgBufferStatus;
67  ProxyDataMsg* curProxyMsg;
68  ProxyDataMsg* prevProxyMsg;
69 
70  // for spanning tree
71  ProxyCombinedResultMsg *msgCBuffer;
72  int parent;
73 //#ifdef NODEAWARE_PROXY_SPANNINGTREE
74  /* Moved to Patch.h */
75  //int *children;
76  //int numChild;
77 //#else
78  /* Moved to Patch.h */
79  //int *child; // spanning tree for recvResults()
80  //int nChild;
81 //#endif
82  int nWait;
83 
84 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
85  CmiNodeLock depositLock;
86 #endif
87 };
88 
89 
90 #endif
91 
void receiveAll(ProxyDataMsg *)
Definition: ProxyPatch.C:245
int getSpanningTreeNChild(void)
Definition: ProxyPatch.h:36
Definition: Patch.h:35
ProxyCombinedResultMsg * depositCombinedResultRawMsg(ProxyCombinedResultRawMsg *)
Definition: ProxyPatch.C:540
void receiveData(ProxyDataMsg *)
Definition: ProxyPatch.C:168
int getSpanningTreeChild(int *)
Definition: ProxyPatch.C:471
int PatchID
Definition: NamdTypes.h:182
ProxyPatch(PatchID pd)
Definition: ProxyPatch.C:26
void setSpanningTree(int, int *, int)
Definition: ProxyPatch.C:455
ProxyCombinedResultMsg * depositCombinedResultMsg(ProxyCombinedResultMsg *)
Definition: ProxyPatch.C:476
int getSpanningTreeParent()
Definition: ProxyPatch.h:33
int * child
Definition: Patch.h:262
const int * getSpanningTreeChildPtr()
Definition: ProxyPatch.h:35
virtual ~ProxyPatch(void)
Definition: ProxyPatch.C:66
virtual void boxClosed(int)
Definition: ProxyPatch.C:107
int nChild
Definition: Patch.h:263