ProxyResultMsg Class Reference

#include <ProxyMgr.h>

List of all members.

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

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< Elem >::begin(), f, forceList, forceListInternal, node, patch, ResizeArray< Elem >::resize(), Vector::x, x, Vector::y, and Vector::z.

00112                                                 {
00113 
00114   void *vmsg = CkAllocBuffer(ptr,sizeof(ProxyResultMsg));
00115   ProxyResultMsg *msg = new (vmsg) ProxyResultMsg;
00116   char *msg_cur = (char*)ptr;
00117 
00118   CmiMemcpy((void*)(&(msg->node)),(void*)msg_cur,sizeof(msg->node));
00119   msg_cur += sizeof(msg->node);
00120   CmiMemcpy((void*)(&(msg->patch)),(void*)msg_cur,sizeof(msg->patch));
00121   msg_cur += sizeof(msg->patch);
00122   int j;
00123   for ( j = 0; j < Results::maxNumForces; ++j ) {
00124     int array_size = *(int *) msg_cur;
00125     msg_cur += sizeof(array_size);
00126     msg->forceList[j] = &(msg->forceListInternal[j]);
00127     msg->forceList[j]->resize(array_size);
00128     char *nonzero = msg_cur;
00129     msg_cur += array_size * sizeof(char);    
00130     msg_cur = (char *)ALIGN_8 (msg_cur);
00131     Vector* farr = (Vector *) msg_cur;
00132     Force* f = msg->forceList[j]->begin();
00133     for ( int i = 0; i < array_size; ++i ) {
00134       if ( nonzero[i] ) {
00135         f[i].x = farr->x;
00136         f[i].y = farr->y;
00137         f[i].z = farr->z;
00138         farr++;
00139       } else {
00140         f[i].x = 0.;  f[i].y = 0.;  f[i].z = 0.;
00141       }
00142     }    
00143     msg_cur = (char *) farr;
00144   }
00145 
00146   CkFreeMsg(ptr);
00147   return msg;
00148 }


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:
Generated on Wed Nov 22 01:17:22 2017 for NAMD by  doxygen 1.4.7