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 voidpack (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

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

Definition at line 112 of file ProxyMgr.C.

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

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

Member Data Documentation

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

Definition at line 168 of file ProxyMgr.h.

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

NodeID ProxyResultMsg::node

Definition at line 166 of file ProxyMgr.h.

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

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: