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 96 of file ProxyMgr.C.

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

00096                                                 {
00097 
00098   void *vmsg = CkAllocBuffer(ptr,sizeof(ProxyResultMsg));
00099   ProxyResultMsg *msg = new (vmsg) ProxyResultMsg;
00100   char *msg_cur = (char*)ptr;
00101 
00102   CmiMemcpy((void*)(&(msg->node)),(void*)msg_cur,sizeof(msg->node));
00103   msg_cur += sizeof(msg->node);
00104   CmiMemcpy((void*)(&(msg->patch)),(void*)msg_cur,sizeof(msg->patch));
00105   msg_cur += sizeof(msg->patch);
00106   int j;
00107   for ( j = 0; j < Results::maxNumForces; ++j ) {
00108     int array_size = *(int *) msg_cur;
00109     msg_cur += sizeof(array_size);
00110     msg->forceList[j].resize(array_size);
00111     char *nonzero = msg_cur;
00112     msg_cur += array_size * sizeof(char);    
00113     msg_cur = (char *)ALIGN_8 (msg_cur);
00114     Vector* farr = (Vector *) msg_cur;
00115     Force* f = msg->forceList[j].begin();
00116     for ( int i = 0; i < array_size; ++i ) {
00117       if ( nonzero[i] ) {
00118         f[i].x = farr->x;
00119         f[i].y = farr->y;
00120         f[i].z = farr->z;
00121         farr++;
00122       } else {
00123         f[i].x = 0.;  f[i].y = 0.;  f[i].z = 0.;
00124       }
00125     }    
00126     msg_cur = (char *) farr;
00127   }
00128 
00129   CkFreeMsg(ptr);
00130   return msg;
00131 }


Member Data Documentation

ForceList ProxyResultMsg::forceList[Results::maxNumForces]
 

Definition at line 111 of file ProxyMgr.h.

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

NodeID ProxyResultMsg::node
 

Definition at line 109 of file ProxyMgr.h.

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

PatchID ProxyResultMsg::patch
 

Definition at line 110 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 Thu Sep 4 04:07:44 2008 for NAMD by  doxygen 1.3.9.1