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

#include <ProxyMgr.h>

Inheritance diagram for ProxyResultMsg:

Static Public Member Functions

static void * pack (ProxyResultMsg *msg)
 
static ProxyResultMsgunpack (void *ptr)
 

Public Attributes

NodeID node
 
PatchID patch
 
ForceListforceList [Results::maxNumForces]
 

Detailed Description

Definition at line 164 of file ProxyMgr.h.

Member Function Documentation

◆ pack()

static void* ProxyResultMsg::pack ( ProxyResultMsg msg)
static

◆ unpack()

ProxyResultMsg * ProxyResultMsg::unpack ( void *  ptr)
static

Definition at line 111 of file ProxyMgr.C.

References ALIGN_8, ResizeArray< Elem >::begin(), ComputeGlobalResultsMsg::f, forceList, Results::maxNumForces, node, patch, ResizeArray< Elem >::resize(), Vector::x, Vector::y, and Vector::z.

111  {
112 
113  void *vmsg = CkAllocBuffer(ptr,sizeof(ProxyResultMsg));
114  ProxyResultMsg *msg = new (vmsg) ProxyResultMsg;
115  char *msg_cur = (char*)ptr;
116 
117  CmiMemcpy((void*)(&(msg->node)),(void*)msg_cur,sizeof(msg->node));
118  msg_cur += sizeof(msg->node);
119  CmiMemcpy((void*)(&(msg->patch)),(void*)msg_cur,sizeof(msg->patch));
120  msg_cur += sizeof(msg->patch);
121  int j;
122  for ( j = 0; j < Results::maxNumForces; ++j ) {
123  int array_size = *(int *) msg_cur;
124  msg_cur += sizeof(array_size);
125  msg->forceList[j] = &(msg->forceListInternal[j]);
126  msg->forceList[j]->resize(array_size);
127  char *nonzero = msg_cur;
128  msg_cur += array_size * sizeof(char);
129  msg_cur = (char *)ALIGN_8 (msg_cur);
130  Vector* farr = (Vector *) msg_cur;
131  Force* f = msg->forceList[j]->begin();
132  for ( int i = 0; i < array_size; ++i ) {
133  if ( nonzero[i] ) {
134  f[i].x = farr->x;
135  f[i].y = farr->y;
136  f[i].z = farr->z;
137  farr++;
138  } else {
139  f[i].x = 0.; f[i].y = 0.; f[i].z = 0.;
140  }
141  }
142  msg_cur = (char *) farr;
143  }
144 
145  CkFreeMsg(ptr);
146  return msg;
147 }
Definition: Vector.h:72
BigReal z
Definition: Vector.h:74
void resize(int i)
Definition: ResizeArray.h:84
PatchID patch
Definition: ProxyMgr.h:167
BigReal x
Definition: Vector.h:74
#define ALIGN_8(x)
Definition: packmsg.h:25
iterator begin(void)
Definition: ResizeArray.h:36
ForceList * forceList[Results::maxNumForces]
Definition: ProxyMgr.h:168
NodeID node
Definition: ProxyMgr.h:166
BigReal y
Definition: Vector.h:74

Member Data Documentation

◆ forceList

ForceList* ProxyResultMsg::forceList[Results::maxNumForces]

Definition at line 168 of file ProxyMgr.h.

Referenced by HomePatch::receiveResults(), and unpack().

◆ node

NodeID ProxyResultMsg::node

Definition at line 166 of file ProxyMgr.h.

Referenced by HomePatch::receiveResults(), and unpack().

◆ patch

PatchID ProxyResultMsg::patch

Definition at line 167 of file ProxyMgr.h.

Referenced by ProxyMgr::recvResults(), ProxyMgr::sendResults(), and unpack().


The documentation for this class was generated from the following files: