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::PatchProxyListMsg ( int  num)
inline

Definition at line 422 of file ProxyMgr.h.

Referenced by createPatchProxyListMsg().

422 { numPatches = num; }

Member Function Documentation

◆ createPatchProxyListMsg()

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

Definition at line 1881 of file ProxyMgr.C.

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

Referenced by NodeProxyMgr::contributeToParent().

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

Member Data Documentation

◆ numPatches

int PatchProxyListMsg::numPatches

Definition at line 416 of file ProxyMgr.h.

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

◆ patchIDs

int* PatchProxyListMsg::patchIDs

Definition at line 417 of file ProxyMgr.h.

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

◆ proxyListLen

int* PatchProxyListMsg::proxyListLen

Definition at line 418 of file ProxyMgr.h.

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

◆ proxyPEs

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: