Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ProxyResultMsg Class Reference

#include <ProxyMgr.h>

List of all members.

Static Public Member Functions

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

Public Attributes

NodeID node
PatchID patch
ForceList forceList [Results::maxNumForces]


Member Function Documentation

void* ProxyResultMsg::pack ProxyResultMsg msg  )  [static]
 

ProxyResultMsg * ProxyResultMsg::unpack void *  ptr  )  [static]
 

Definition at line 108 of file ProxyMgr.C.

References ALIGN_8, ResizeArray< Elem >::begin(), Force, forceList, j, node, patch, ResizeArray< Elem >::resize(), Vector::x, Vector::y, and Vector::z.

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


Member Data Documentation

ForceList ProxyResultMsg::forceList[Results::maxNumForces]
 

Definition at line 170 of file ProxyMgr.h.

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

NodeID ProxyResultMsg::node
 

Definition at line 168 of file ProxyMgr.h.

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

PatchID ProxyResultMsg::patch
 

Definition at line 169 of file ProxyMgr.h.

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


The documentation for this class was generated from the following files:
Generated on Sun Feb 12 04:08:04 2012 for NAMD by  doxygen 1.3.9.1