00001
00007 #ifndef PROXYPATCH_H
00008 #define PROXYPATCH_H
00009
00010 #include "Patch.h"
00011
00012 class ProxyDataMsg;
00013 class ProxyAtomsMsg;
00014
00015
00016 #define PROXYMSGNOTBUFFERED 0
00017 #define PROXYDATAMSGBUFFERED 1
00018 #define PROXYALLMSGBUFFERED 2
00019
00020 class ProxyPatch : public Patch
00021 {
00022 public:
00023
00024 ProxyPatch(PatchID pd);
00025 virtual ~ProxyPatch(void);
00026
00027 void receiveAtoms(ProxyAtomsMsg*);
00028 void receiveData(ProxyDataMsg*);
00029 void receiveAll(ProxyDataMsg*);
00030
00031 void setSpanningTree(int, int*, int);
00032 int getSpanningTreeParent() { return parent; }
00033 int getSpanningTreeChild(int *);
00034 inline int getSpanningTreeNChild(void) {
00035 #ifdef NODEAWARE_PROXY_SPANNINGTREE
00036 return numChild;
00037 #else
00038 return nChild;
00039 #endif
00040 }
00041
00042 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00043 void setSTNodeChildren(int numNids, int *nids);
00044 int getSTNodeChild(int *nodeChildren_) {
00045 for(int i=0; i<numNodeChild; i++) nodeChildren_[i] = nodeChildren[i];
00046 return numNodeChild;
00047 }
00048 int getSTNNodeChild() { return numNodeChild; }
00049 #endif
00050
00051
00052 ProxyCombinedResultMsg *depositCombinedResultMsg(ProxyCombinedResultMsg *);
00053
00054 #if CMK_PERSISTENT_COMM
00055 private:
00056 PersistentHandle localphs;
00057 #endif
00058 protected:
00059
00060 virtual void boxClosed(int);
00061
00062 private:
00063
00064 void sendResults(void);
00065
00066
00067
00068
00069 int proxyMsgBufferStatus;
00070 ProxyDataMsg* curProxyMsg;
00071 ProxyDataMsg* prevProxyMsg;
00072
00073
00074 ProxyCombinedResultMsg *msgCBuffer;
00075 int parent;
00076 #ifdef NODEAWARE_PROXY_SPANNINGTREE
00077
00078
00079
00080 #else
00081 int *child;
00082 int nChild;
00083 #endif
00084 int nWait;
00085
00086 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00087 CmiNodeLock depositLock;
00088 #endif
00089 };
00090
00091
00092 #endif
00093