NAMD
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PatchProxyListMsg Class Reference

#include <ProxyMgr.h>

Inheritance diagram for PatchProxyListMsg:

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().

422 { 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().

1882  {
1883  //1. compute the total patches this node manages, and the total length of all proxy lists
1884  int totalPatches = 0;
1885  int totalProxies = 0;
1886  for(int i=0; i<bufSize; i++) {
1887  PatchProxyListMsg *one = bufs[i];
1888  totalPatches += one->numPatches;
1889  for(int j=0; j<one->numPatches; j++) totalProxies += one->proxyListLen[j];
1890  }
1891  totalPatches += size;
1892  for(int i=0; i<size; i++) {
1893  totalProxies += info[i].numProxies;
1894  }
1895 
1896  PatchProxyListMsg *msg = new(totalPatches, totalPatches, totalProxies, 0)PatchProxyListMsg(totalPatches);
1897  int msgPatchIdx = 0;
1898  int msgProxyPeIdx = 0;
1899  for(int i=0; i<bufSize; i++) {
1900  PatchProxyListMsg *one = bufs[i];
1901  int curPeIdx = 0;
1902  for(int j=0; j<one->numPatches; j++) {
1903  msg->patchIDs[msgPatchIdx] = one->patchIDs[j];
1904  int curListLen = one->proxyListLen[j];
1905  msg->proxyListLen[msgPatchIdx++] = curListLen;
1906  memcpy(msg->proxyPEs+msgProxyPeIdx, one->proxyPEs+curPeIdx, sizeof(int)*curListLen);
1907  curPeIdx += curListLen;
1908  msgProxyPeIdx += curListLen;
1909  }
1910  }
1911  for(int i=0; i<size; i++) {
1912  msg->patchIDs[msgPatchIdx] = info[i].patchID;
1913  int curListLen = info[i].numProxies;
1914  msg->proxyListLen[msgPatchIdx++] = curListLen;
1915  memcpy(msg->proxyPEs+msgProxyPeIdx, info[i].proxyList, sizeof(int)*curListLen);
1916  msgProxyPeIdx += curListLen;
1917  }
1918  return msg;
1919 }
int numProxies
Definition: ProxyMgr.h:410
int * proxyListLen
Definition: ProxyMgr.h:418
int * proxyList
Definition: ProxyMgr.h:411
PatchProxyListMsg(int num)
Definition: ProxyMgr.h:422

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: