PatchProxyListMsg Class Reference

#include <ProxyMgr.h>

List of all members.

Public Member Functions

 PatchProxyListMsg (int num)

Static Public Member Functions

static PatchProxyListMsgcreatePatchProxyListMsg (PatchProxyListMsg **bufs, int bufSize, ProxyListInfo *info, int size)

Public Attributes

int numPatches
int * patchIDs
int * proxyListLen
int * proxyPEs


Detailed Description

Definition at line 414 of file ProxyMgr.h.


Constructor & Destructor Documentation

PatchProxyListMsg::PatchProxyListMsg ( int  num  )  [inline]

Definition at line 422 of file ProxyMgr.h.

References numPatches.

Referenced by createPatchProxyListMsg().

00422 { numPatches = num; }


Member Function Documentation

PatchProxyListMsg * PatchProxyListMsg::createPatchProxyListMsg ( PatchProxyListMsg **  bufs,
int  bufSize,
ProxyListInfo info,
int  size 
) [static]

Definition at line 1882 of file ProxyMgr.C.

References numPatches, ProxyListInfo::numProxies, ProxyListInfo::patchID, patchIDs, PatchProxyListMsg(), ProxyListInfo::proxyList, proxyListLen, and proxyPEs.

Referenced by NodeProxyMgr::contributeToParent().

01882                                                                                                                                  {
01883         //1. compute the total patches this node manages, and the total length of all proxy lists
01884         int totalPatches = 0;
01885         int totalProxies = 0;
01886         for(int i=0; i<bufSize; i++) {
01887                 PatchProxyListMsg *one = bufs[i];
01888                 totalPatches += one->numPatches;
01889                 for(int j=0; j<one->numPatches; j++) totalProxies += one->proxyListLen[j];
01890         }
01891         totalPatches += size;
01892         for(int i=0; i<size; i++) {
01893                 totalProxies += info[i].numProxies;
01894         }
01895 
01896         PatchProxyListMsg *msg = new(totalPatches, totalPatches, totalProxies, 0)PatchProxyListMsg(totalPatches);
01897         int msgPatchIdx = 0;
01898         int msgProxyPeIdx = 0;
01899         for(int i=0; i<bufSize; i++) {
01900                 PatchProxyListMsg *one = bufs[i];
01901                 int curPeIdx = 0;
01902                 for(int j=0; j<one->numPatches; j++) {
01903                         msg->patchIDs[msgPatchIdx] = one->patchIDs[j];
01904                         int curListLen = one->proxyListLen[j];
01905                         msg->proxyListLen[msgPatchIdx++] = curListLen;
01906                         memcpy(msg->proxyPEs+msgProxyPeIdx, one->proxyPEs+curPeIdx, sizeof(int)*curListLen);
01907                         curPeIdx += curListLen;
01908                         msgProxyPeIdx += curListLen;
01909                 }
01910         }
01911         for(int i=0; i<size; i++) {
01912                 msg->patchIDs[msgPatchIdx] = info[i].patchID;
01913                 int curListLen = info[i].numProxies;
01914                 msg->proxyListLen[msgPatchIdx++] = curListLen;
01915                 memcpy(msg->proxyPEs+msgProxyPeIdx, info[i].proxyList, sizeof(int)*curListLen);
01916                 msgProxyPeIdx += curListLen;
01917         }
01918         return msg;
01919 }


Member Data Documentation

int PatchProxyListMsg::numPatches

Definition at line 416 of file ProxyMgr.h.

Referenced by createPatchProxyListMsg(), and ProxyMgr::recvPatchProxyInfo().

int* PatchProxyListMsg::patchIDs

Definition at line 417 of file ProxyMgr.h.

Referenced by createPatchProxyListMsg(), and ProxyMgr::recvPatchProxyInfo().

int* PatchProxyListMsg::proxyListLen

Definition at line 418 of file ProxyMgr.h.

Referenced by createPatchProxyListMsg(), and ProxyMgr::recvPatchProxyInfo().

int* PatchProxyListMsg::proxyPEs

Definition at line 419 of file ProxyMgr.h.

Referenced by createPatchProxyListMsg(), and ProxyMgr::recvPatchProxyInfo().


The documentation for this class was generated from the following files:
Generated on Mon Sep 25 01:17:19 2017 for NAMD by  doxygen 1.4.7