Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

NodeProxyMgr Class Reference

#include <ProxyMgr.h>

List of all members.

Public Member Functions

 NodeProxyMgr ()
 ~NodeProxyMgr ()
void createProxyInfo (int numPs)
void registerPatch (int patchID, int numPes, int *pes)
proxyTreeNodegetPatchProxyInfo (int patchID)
void registerLocalProxyMgr (CkGroupID one)
const CkGroupID & getLocalProxyMgr ()
void registerLocalPatchMap (int rank, PatchMap *one)
PatchMapgetLocalPatchMap (int rank)
void recvImmediateProxyData (ProxyDataMsg *msg)
void recvImmediateProxyAll (ProxyDataMsg *msg)
void recvImmediateResults (ProxyCombinedResultMsg *)


Constructor & Destructor Documentation

NodeProxyMgr::NodeProxyMgr  )  [inline]
 

Definition at line 345 of file ProxyMgr.h.

00345                   {
00346         proxyInfo = NULL;
00347         numPatches = 0;
00348         localPatchMaps = new PatchMap *[CkMyNodeSize()];
00349     }

NodeProxyMgr::~NodeProxyMgr  )  [inline]
 

Definition at line 350 of file ProxyMgr.h.

00350                    {
00351         for(int i=0; i<numPatches; i++) {
00352             delete proxyInfo[i];
00353         }
00354         delete [] proxyInfo;
00355         delete [] localPatchMaps;
00356     }


Member Function Documentation

void NodeProxyMgr::createProxyInfo int  numPs  )  [inline]
 

Definition at line 358 of file ProxyMgr.h.

00358                                    {
00359         numPatches = numPs;
00360         proxyInfo = new proxyTreeNode *[numPs];
00361         memset(proxyInfo, 0, sizeof(proxyTreeNode *)*numPs);
00362     }

PatchMap* NodeProxyMgr::getLocalPatchMap int  rank  )  [inline]
 

Definition at line 377 of file ProxyMgr.h.

00377                                         {
00378         return localPatchMaps[rank];
00379     }   

const CkGroupID& NodeProxyMgr::getLocalProxyMgr  )  [inline]
 

Definition at line 371 of file ProxyMgr.h.

00371                                        {
00372         return localProxyMgr;
00373     }

proxyTreeNode* NodeProxyMgr::getPatchProxyInfo int  patchID  )  [inline]
 

Definition at line 364 of file ProxyMgr.h.

00364                                                  {
00365         return proxyInfo[patchID];
00366     }

void NodeProxyMgr::recvImmediateProxyAll ProxyDataMsg msg  ) 
 

Definition at line 1591 of file ProxyMgr.C.

References proxyTreeNode::numPes, PatchMap::patch(), ProxyDataMsg::patch, and proxyTreeNode::peIDs.

01591                                                           {    
01592 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
01593     CProxy_ProxyMgr cp(localProxyMgr);
01594     proxyTreeNode *ptn = proxyInfo[msg->patch];
01595     CmiAssert(ptn->numPes!=0);
01596     #if defined(PROCTRACE_DEBUG) && defined(NAST_DEBUG)
01597     //This could be executed on comm thd.
01598     printf("NodePMgr::recvImmPAll for patch[%d] on node %d rank %d, prepare to send proc ", msg->patch, CkMyNode(), CkMyRank());
01599     for(int i=0; i<ptn->numPes; i++) {
01600         printf("%d, ", ptn->peIDs[i]);
01601     }
01602     printf("\n");
01603     fflush(stdout);
01604     #endif
01605 
01606     //re-send msg to this nodes's children nodes.
01607     //only the first pe of a node of node-aware ST should contain children nodes
01608     int rank = CkRankOf(ptn->peIDs[0]);
01609     PatchMap *pmap = localPatchMaps[rank];
01610     ProxyPatch *ppatch = (ProxyPatch *)pmap->patch(msg->patch);
01611 
01612     int npid = ppatch->getSTNNodeChild();
01613     int pids[npid];
01614     if(npid>0) {        
01615         ppatch->getSTNodeChild(pids);
01616         //only needs to send to other nodes, so check the last entry of pids.
01617         //This is because the data for proxies on the same node have been sent
01618         //by NodeProxyMgr.
01619         if(pids[npid-1]==CkMyNode()) npid--;
01620     }
01621     
01622     CProxy_NodeProxyMgr cnp(thisgroup);
01623     for(int i=0; i<npid; i++) {
01624         ProxyDataMsg *copymsg = (ProxyDataMsg *)CkCopyMsg((void **)&msg);
01625         cnp[pids[i]].recvImmediateProxyAll(copymsg);
01626     }    
01627 
01628     //re-send msg to it's internal cores
01629 #if CMK_SMP && defined(NAMDSRC_IMMQD_HACK)
01630     msg->isFromImmMsgCall = (CkMyRank()==CkMyNodeSize());
01631 #endif
01632     cp.recvProxyAll(msg, ptn->numPes, ptn->peIDs);
01633 #else
01634     CkAbort("Bad execution path to NodeProxyMgr::recvImmediateProxyData\n");
01635 #endif
01636 }

void NodeProxyMgr::recvImmediateProxyData ProxyDataMsg msg  ) 
 

Definition at line 1495 of file ProxyMgr.C.

References proxyTreeNode::numPes, PatchMap::patch(), ProxyDataMsg::patch, and proxyTreeNode::peIDs.

01495                                                            {    
01496 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
01497     CProxy_ProxyMgr cp(localProxyMgr);
01498     proxyTreeNode *ptn = proxyInfo[msg->patch];
01499     CmiAssert(ptn->numPes!=0);
01500 
01501     //re-send msg to this nodes's children nodes.
01502     //only the first pe of a node of node-aware ST should contain children nodes
01503     int rank = CkRankOf(ptn->peIDs[0]);
01504     PatchMap *pmap = localPatchMaps[rank];
01505     ProxyPatch *ppatch = (ProxyPatch *)pmap->patch(msg->patch);
01506 
01507     int npid = ppatch->getSTNNodeChild();
01508     int pids[npid];
01509     if(npid>0) {        
01510         ppatch->getSTNodeChild(pids);
01511         //only needs to send to other nodes, so check the last entry of pids.
01512         //This is because the data for proxies on the same node have been sent
01513         //by NodeProxyMgr.
01514         if(pids[npid-1]==CkMyNode()) npid--;
01515     }    
01516     CProxy_NodeProxyMgr cnp(thisgroup);
01517     for(int i=0; i<npid; i++) {
01518         ProxyDataMsg *copymsg = (ProxyDataMsg *)CkCopyMsg((void **)&msg);
01519         cnp[pids[i]].recvImmediateProxyData(copymsg);
01520     }    
01521 
01522     //re-send msg to it's internal cores
01523 #if CMK_SMP && defined(NAMDSRC_IMMQD_HACK)
01524     msg->isFromImmMsgCall = (CkMyRank()==CkMyNodeSize());
01525 #endif
01526     cp.recvProxyData(msg, ptn->numPes, ptn->peIDs);
01527 #else
01528     CkAbort("Bad execution path to NodeProxyMgr::recvImmediateProxyData\n");
01529 #endif
01530 }

void NodeProxyMgr::recvImmediateResults ProxyCombinedResultMsg  ) 
 

Definition at line 1405 of file ProxyMgr.C.

References ProxyPatch::depositCombinedResultMsg(), ProxyPatch::getSpanningTreeParent(), PatchMap::homePatch(), PatchMap::patch(), and ProxyCombinedResultMsg::patch.

01405                                                                   {
01406 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
01407     //CkPrintf("recvImmRes called on comm thread%d pe[%d]\n", CkMyRank()==CmiMyNodeSize(), CkMyPe());
01408     //fflush(stdout);
01409     
01410     int destRank = CkRankOf(msg->destPe);
01411     PatchMap *pmap = localPatchMaps[destRank];
01412     HomePatch *home = pmap->homePatch(msg->patch);
01413     if (home) {
01414 #if CMK_SMP && defined(NAMDSRC_IMMQD_HACK)
01415         msg->isFromImmMsgCall = (CkMyRank()==CkMyNodeSize());
01416 #endif
01417         CProxy_ProxyMgr cp(localProxyMgr);        
01418         cp[msg->destPe].recvResults(msg);        
01419 /*
01420         char *srcfrom = "Isfrom";
01421         if(CkMyRank()!=CmiMyNodeSize()) srcfrom="Notfrom";
01422       CkPrintf("%s comm thread from pe[%d]\n", srcfrom, CkMyPe());
01423       fflush(stdout);
01424 */  
01425     }
01426     else {
01427         ProxyPatch *patch = (ProxyPatch *)pmap->patch(msg->patch);
01428         ProxyCombinedResultMsg *cMsg = patch->depositCombinedResultMsg(msg);
01429         if (cMsg) {
01430             CProxy_NodeProxyMgr cnp(thisgroup);
01431             cMsg->destPe = patch->getSpanningTreeParent();
01432             cnp[CkNodeOf(cMsg->destPe)].recvImmediateResults(cMsg);            
01433         }
01434     }
01435 #endif    
01436 }

void NodeProxyMgr::registerLocalPatchMap int  rank,
PatchMap one
[inline]
 

Definition at line 374 of file ProxyMgr.h.

00374                                                        {
00375         localPatchMaps[rank] = one;
00376     }

void NodeProxyMgr::registerLocalProxyMgr CkGroupID  one  )  [inline]
 

Definition at line 368 of file ProxyMgr.h.

00368                                              {
00369         localProxyMgr = one;
00370     }

void NodeProxyMgr::registerPatch int  patchID,
int  numPes,
int *  pes
 

Definition at line 1675 of file ProxyMgr.C.

Referenced by ProxyMgr::recvNodeAwareSpanningTree().

01675                                                                  {
01676     if(proxyInfo[patchID]) {
01677         delete proxyInfo[patchID];
01678     }
01679     if(numPes == 0) {
01680         proxyInfo[patchID] = NULL;
01681     }else{
01682         proxyInfo[patchID] = new proxyTreeNode(CkNodeOf(pes[0]),numPes,pes);
01683     }
01684 }


The documentation for this class was generated from the following files:
Generated on Tue Nov 24 04:07:50 2009 for NAMD by  doxygen 1.3.9.1