ProxyPatch Class Reference

#include <ProxyPatch.h>

Inheritance diagram for ProxyPatch:

Patch List of all members.

Public Member Functions

 ProxyPatch (PatchID pd)
virtual ~ProxyPatch (void)
void receiveData (ProxyDataMsg *)
void receiveAll (ProxyDataMsg *)
void receiveData (ProxyGBISP2DataMsg *)
void receiveData (ProxyGBISP3DataMsg *)
void setSpanningTree (int, int *, int)
int getSpanningTreeParent ()
int getSpanningTreeChild (int *)
const int * getSpanningTreeChildPtr ()
int getSpanningTreeNChild (void)
ProxyCombinedResultMsgdepositCombinedResultMsg (ProxyCombinedResultMsg *)
ProxyCombinedResultMsgdepositCombinedResultRawMsg (ProxyCombinedResultRawMsg *)

Protected Member Functions

virtual void boxClosed (int)

Detailed Description

Definition at line 19 of file ProxyPatch.h.


Constructor & Destructor Documentation

ProxyPatch::ProxyPatch ( PatchID  pd  ) 

Definition at line 23 of file ProxyPatch.C.

References Patch::child, DebugM, Patch::nChild, Patch::numAtoms, PatchMap::Object(), ProxyMgr::Object(), Patch::patchID, proxySpanDim, and ProxyMgr::registerProxy().

00023                                  : 
00024   Patch(pd), proxyMsgBufferStatus(PROXYMSGNOTBUFFERED), 
00025   curProxyMsg(NULL), prevProxyMsg(NULL)
00026 {
00027   DebugM(4, "ProxyPatch(" << pd << ") at " << this << "\n");
00028   ProxyMgr::Object()->registerProxy(patchID);
00029   numAtoms = -1;
00030   parent = -1;
00031 
00032 #ifndef NODEAWARE_PROXY_SPANNINGTREE
00033   nChild = 0;
00034   child = new int[proxySpanDim];
00035 #endif
00036 
00037 #if CMK_PERSISTENT_COMM && USE_PERSISTENT_TREE
00038   localphs = 0;
00039 #ifdef REMOVE_PROXYRESULTMSG_EXTRACOPY
00040   int msgstart = sizeof(envelope)+sizeof(ProxyResultVarsizeMsg);
00041 #else
00042   int msgstart = sizeof(envelope)+sizeof(ProxyResultMsg);
00043 #endif
00044   localphs = CmiCreatePersistent(PatchMap::Object()->node(patchID), 30000, msgstart);
00045   ntreephs = 0;
00046 #ifdef NODEAWARE_PROXY_SPANNINGTREE
00047   treephs = NULL;
00048 #else
00049   treephs = new PersistentHandle[proxySpanDim];
00050 #endif
00051 #endif
00052 
00053   // DMK - Atom Separation (water vs. non-water)
00054   #if NAMD_SeparateWaters != 0
00055     numWaterAtoms = -1;
00056   #endif
00057   
00058   #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00059     depositLock = CmiCreateLock();
00060   #endif
00061 }

ProxyPatch::~ProxyPatch ( void   )  [virtual]

Definition at line 63 of file ProxyPatch.C.

References Patch::atomMapper, ResizeArray< Elem >::begin(), Patch::child, DebugM, ResizeArray< Elem >::end(), Patch::lcpoType, ProxyMgr::Object(), Patch::p, Patch::patchID, Patch::pExt, ResizeArray< Elem >::resize(), AtomMapper::unregisterIDsCompAtomExt(), and ProxyMgr::unregisterProxy().

00064 {
00065   DebugM(4, "ProxyPatch(" << patchID << ") deleted at " << this << "\n");
00066   ProxyMgr::Object()->unregisterProxy(patchID);
00067 
00068   // ProxyPatch may be freed because of load balancing if the compute object
00069   // it corresponds to no longer exist on this specific processor.
00070   CmiAssert(prevProxyMsg!=NULL);
00071   if(prevProxyMsg!=NULL) {
00072 // #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
00073 //       AtomMap::Object()->unregisterIDs(patchID,positionPtrBegin, positionPtrEnd);
00074 // #else
00075       atomMapper->unregisterIDsCompAtomExt(pExt.begin(),pExt.end());
00076 // #endif      
00077 #if ! CMK_PERSISTENT_COMM || ! USE_PERSISTENT_TREE
00078       delete prevProxyMsg;
00079 #endif
00080       prevProxyMsg = NULL;
00081   }
00082 
00083 
00084 #ifdef NODEAWARE_PROXY_SPANNINGTREE
00085   #ifdef USE_NODEPATCHMGR
00086   delete [] nodeChildren;  
00087   #endif
00088 #endif
00089   delete [] child;
00090 
00091   p.resize(0);
00092   pExt.resize(0);
00093 
00094   lcpoType.resize(0);
00095 
00096 #if CMK_PERSISTENT_COMM && USE_PERSISTENT_TREE
00097   CmiDestoryPersistent(localphs);
00098   localphs = 0;
00099   for (int i=0; i<ntreephs; i++)  CmiDestoryPersistent(treephs[i]);
00100   delete [] treephs;
00101 #endif
00102 }


Member Function Documentation

void ProxyPatch::boxClosed ( int   )  [protected, virtual]

Implements Patch.

Definition at line 104 of file ProxyPatch.C.

References Patch::boxesOpen, DebugM, Patch::dEdaSum, ProxyGBISP2ResultMsg::dEdaSum, ProxyGBISP2ResultMsg::dEdaSumLen, Flags::doFullElectrostatics, Flags::doNonbonded, Patch::flags, GB1_PROXY_RESULTS_PRIORITY, GB2_PROXY_RESULTS_PRIORITY, Patch::numAtoms, ProxyMgr::Object(), ProxyGBISP2ResultMsg::origPe, ProxyGBISP1ResultMsg::origPe, ProxyGBISP2ResultMsg::patch, ProxyGBISP1ResultMsg::patch, PATCH_PRIORITY, Patch::patchID, PRIORITY_SIZE, PROXYALLMSGBUFFERED, PROXYDATAMSGBUFFERED, Patch::psiSum, ProxyGBISP1ResultMsg::psiSum, ProxyGBISP1ResultMsg::psiSumLen, receiveAll(), receiveData(), ProxyMgr::sendResult(), Flags::sequence, and SET_PRIORITY.

00104                                   {
00105   ProxyGBISP1ResultMsg *msg1;
00106   ProxyGBISP2ResultMsg *msg2;
00107  
00108   if (box == 1) { // force Box
00109     // Note: delay the deletion of proxyDataMsg (of the 
00110     // current step) until the next step. This is done 
00111     // for the sake of atom migration (ProxyDataMsg) 
00112     // as the ProxyPatch has to  unregister the atoms 
00113     // of the previous step in the AtomMap data structure 
00114     // also denotes end of gbis phase 3
00115     sendResults();
00116   } else if ( box == 5) {//end phase 1
00117     //this msg should only have nonzero atoms if flags.doNonbonded
00118     int msgAtoms = (flags.doNonbonded) ? numAtoms : 0;
00119     msg1 = new (msgAtoms,PRIORITY_SIZE) ProxyGBISP1ResultMsg;
00120     for (int i = 0; i < msgAtoms; i++) {
00121       msg1->psiSum[i] = psiSum[i];
00122     }
00123     msg1->patch = patchID;
00124     msg1->psiSumLen = msgAtoms;
00125     msg1->origPe = CkMyPe();
00126     SET_PRIORITY(msg1,flags.sequence,GB1_PROXY_RESULTS_PRIORITY + PATCH_PRIORITY(patchID));
00127     ProxyMgr::Object()->sendResult(msg1);
00128   } else if ( box == 8) {//end phase 2
00129     //this msg should only have nonzero atoms if flags.doFullElectrostatics
00130     int msgAtoms = (flags.doFullElectrostatics) ? numAtoms : 0;
00131     msg2 = new (msgAtoms,PRIORITY_SIZE) ProxyGBISP2ResultMsg;
00132     for (int i = 0; i < msgAtoms; i++) {
00133       msg2->dEdaSum[i] = dEdaSum[i];
00134     }
00135     msg2->patch = patchID;
00136     msg2->dEdaSumLen = msgAtoms;
00137     msg2->origPe = CkMyPe();
00138     SET_PRIORITY(msg2,flags.sequence,GB2_PROXY_RESULTS_PRIORITY + PATCH_PRIORITY(patchID));
00139     ProxyMgr::Object()->sendResult(msg2);
00140   } else if (box == 9) {
00141     //nothing
00142   } else if (box == 10) {
00143     // LCPO do nothing
00144   }
00145 
00146 
00147   if ( ! --boxesOpen ) {
00148     DebugM(2,patchID << ": " << "Checking message buffer.\n");    
00149     
00150     if(proxyMsgBufferStatus == PROXYALLMSGBUFFERED) {
00151           CmiAssert(curProxyMsg != NULL);
00152           DebugM(3,"Patch " << patchID << " processing buffered proxy ALL data.\n");
00153           receiveAll(curProxyMsg);          
00154     }else if(proxyMsgBufferStatus == PROXYDATAMSGBUFFERED) {
00155           CmiAssert(curProxyMsg != NULL);
00156           DebugM(3,"Patch " << patchID << " processing buffered proxy data.\n");
00157           receiveData(curProxyMsg);
00158     }
00159   } else {
00160        DebugM(3,"ProxyPatch " << patchID << ": " << boxesOpen << " boxes left to close.\n");
00161   }
00162 }

ProxyCombinedResultMsg * ProxyPatch::depositCombinedResultMsg ( ProxyCombinedResultMsg  ) 

Definition at line 461 of file ProxyPatch.C.

References ResizeArray< Elem >::add(), ResizeArray< Elem >::begin(), ResizeArray< Elem >::end(), ProxyCombinedResultMsg::forceList, ProxyCombinedResultMsg::nodes, and x.

Referenced by ProxyMgr::sendResults().

00461                                                                                         {
00462 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00463   CmiLock(depositLock);
00464 #endif
00465   nWait++;
00466   if (nWait == 1) msgCBuffer = msg;
00467   else {
00468     NodeIDList::iterator n_i, n_e;
00469     n_i = msg->nodes.begin();
00470     n_e = msg->nodes.end();
00471     for (; n_i!=n_e; ++n_i) msgCBuffer->nodes.add(*n_i);
00472     for ( int k = 0; k < Results::maxNumForces; ++k )
00473     {
00474     register ForceList::iterator r_i;
00475     r_i = msgCBuffer->forceList[k]->begin();
00476     register ForceList::iterator f_i, f_e;
00477     f_i = msg->forceList[k]->begin();
00478     f_e = msg->forceList[k]->end();
00479     //    for ( ; f_i != f_e; ++f_i, ++r_i ) *r_i += *f_i;
00480 
00481     int nf = f_e - f_i;
00482 #ifdef ARCH_POWERPC
00483 #pragma disjoint (*f_i, *r_i)
00484 #pragma unroll(4)
00485 #endif
00486     for (int count = 0; count < nf; count++) {
00487       r_i[count].x += f_i[count].x;      
00488       r_i[count].y += f_i[count].y;      
00489       r_i[count].z += f_i[count].z;
00490     }
00491 
00492     }
00493     delete msg;
00494   }
00495 //CkPrintf("[%d:%d] wait: %d of %d (%d %d %d)\n", CkMyPe(), patchID, nWait, nChild+1, parent, child[0],child[1]);
00496   if (nWait == nChild + 1) {
00497     nWait = 0;
00498 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00499     CmiUnlock(depositLock);
00500 #endif
00501     
00502     return msgCBuffer;
00503   }
00504 
00505 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00506   CmiUnlock(depositLock);
00507 #endif
00508 
00509   return NULL;
00510 }

ProxyCombinedResultMsg * ProxyPatch::depositCombinedResultRawMsg ( ProxyCombinedResultRawMsg  ) 

Definition at line 525 of file ProxyPatch.C.

References ResizeArray< Elem >::add(), ResizeArray< Elem >::begin(), ProxyCombinedResultRawMsg::flLen, ProxyCombinedResultRawMsg::forceArr, ProxyCombinedResultMsg::forceList, ProxyCombinedResultMsg::fromRaw(), ProxyCombinedResultRawMsg::isForceNonZero, ProxyCombinedResultRawMsg::nodes, ProxyCombinedResultMsg::nodes, ProxyCombinedResultRawMsg::nodeSize, Vector::x, x, Vector::y, and Vector::z.

Referenced by NodeProxyMgr::recvImmediateResults(), and ProxyMgr::recvImmediateResults().

00525                                                                                               {
00526 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00527   CmiLock(depositLock);
00528 #endif
00529   nWait++;
00530   if (nWait == 1) msgCBuffer = ProxyCombinedResultMsg::fromRaw(msg);
00531   else {
00532     for (int i=0; i<msg->nodeSize; i++) msgCBuffer->nodes.add(msg->nodes[i]);
00533 
00534     register char* isNonZero = msg->isForceNonZero;
00535         register Force* f_i = msg->forceArr;
00536         for ( int k = 0; k < Results::maxNumForces; ++k )
00537     {
00538                 register ForceList::iterator r_i;
00539                 r_i = msgCBuffer->forceList[k]->begin();
00540         int nf = msg->flLen[k];
00541 
00542 #ifdef ARCH_POWERPC
00543 #pragma disjoint (*f_i, *r_i)
00544 #endif
00545                 for (int count = 0; count < nf; count++) {
00546                         if(*isNonZero){
00547                                 r_i[count].x += f_i->x;
00548                                 r_i[count].y += f_i->y;
00549                                 r_i[count].z += f_i->z;
00550                                 f_i++;
00551                         }
00552                         isNonZero++;
00553                 }
00554     }
00555     delete msg;
00556   }
00557 //CkPrintf("[%d:%d] wait: %d of %d (%d %d %d)\n", CkMyPe(), patchID, nWait, nChild+1, parent, child[0],child[1]);
00558   if (nWait == nChild + 1) {
00559     nWait = 0;
00560 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00561     CmiUnlock(depositLock);
00562 #endif
00563 
00564     return msgCBuffer;
00565   }
00566 
00567 #if defined(NODEAWARE_PROXY_SPANNINGTREE) && defined(USE_NODEPATCHMGR)
00568   CmiUnlock(depositLock);
00569 #endif
00570 
00571   return NULL;
00572 }

int ProxyPatch::getSpanningTreeChild ( int *   ) 

Definition at line 456 of file ProxyPatch.C.

References Patch::child.

00456                                            { 
00457   for (int i=0; i<nChild; i++) c[i] = child[i];
00458   return nChild;
00459 }

const int* ProxyPatch::getSpanningTreeChildPtr (  )  [inline]

Definition at line 35 of file ProxyPatch.h.

References Patch::child.

Referenced by ProxyMgr::recvImmediateProxyAll(), and ProxyMgr::recvImmediateProxyData().

00035 { return child; }

int ProxyPatch::getSpanningTreeNChild ( void   )  [inline]

Definition at line 36 of file ProxyPatch.h.

References Patch::nChild.

Referenced by ProxyMgr::recvImmediateProxyAll(), and ProxyMgr::recvImmediateProxyData().

00036 { return nChild; }

int ProxyPatch::getSpanningTreeParent (  )  [inline]

Definition at line 33 of file ProxyPatch.h.

Referenced by NodeProxyMgr::recvImmediateResults(), ProxyMgr::recvImmediateResults(), and ProxyMgr::sendResults().

00033 { return parent; }

void ProxyPatch::receiveAll ( ProxyDataMsg  ) 

Definition at line 236 of file ProxyPatch.C.

References Patch::atomMapper, ProxyDataMsg::avgPlLen, ProxyDataMsg::avgPositionList, Patch::avgPositionPtrBegin, Patch::avgPositionPtrEnd, ResizeArray< Elem >::begin(), Patch::boxesOpen, ProxyDataMsg::cudaAtomList, Patch::cudaAtomPtr, DebugM, Flags::doGBIS, Flags::doLCPO, ResizeArray< Elem >::end(), ProxyDataMsg::flags, Patch::flags, Patch::intRad, ProxyDataMsg::intRadList, Patch::lcpoType, ProxyDataMsg::lcpoTypeList, NAMD_bug(), Patch::numAtoms, Patch::p, Patch::patchID, Patch::pExt, ProxyDataMsg::plLen, ProxyDataMsg::positionList, PROXYALLMSGBUFFERED, ResizeArray< Elem >::resize(), AtomMapper::unregisterIDsCompAtomExt(), ProxyDataMsg::velocityList, Patch::velocityPtrBegin, Patch::velocityPtrEnd, and ProxyDataMsg::vlLen.

Referenced by boxClosed(), and ProxyMgr::recvProxyAll().

00237 {
00238   DebugM(3, "receiveAll(" << patchID << ")\n");
00239 
00240   if ( boxesOpen )
00241   {
00242     proxyMsgBufferStatus = PROXYALLMSGBUFFERED;    
00243     curProxyMsg = msg;
00244     return;
00245   }  
00246 
00247   //The prevProxyMsg has to be deleted after this if-statement because
00248   // positionPtrBegin points to the space inside the prevProxyMsg
00249   if(prevProxyMsg!=NULL) {
00250 // #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
00251 //       AtomMap::Object()->unregisterIDs(patchID,positionPtrBegin,positionPtrEnd);
00252 // #else
00253       atomMapper->unregisterIDsCompAtomExt(pExt.begin(), pExt.end());
00254 // #endif
00255   }
00256   //Now delete the ProxyDataMsg of the previous step
00257 #if ! CMK_PERSISTENT_COMM || ! USE_PERSISTENT_TREE
00258   delete prevProxyMsg;
00259 #endif
00260   curProxyMsg = msg;
00261   prevProxyMsg = curProxyMsg;
00262 
00263   flags = msg->flags;
00264 
00265 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
00266   if ( ((int64)msg->positionList) % 32 ) { // not aligned
00267     p.resize(msg->plLen);
00268     positionPtrBegin = p.begin();
00269     memcpy(positionPtrBegin, msg->positionList, sizeof(CompAtom)*(msg->plLen));
00270   } else { // aligned
00271     positionPtrBegin = msg->positionList;
00272   }
00273   positionPtrEnd = positionPtrBegin + msg->plLen;
00274   if ( ((int64)positionPtrBegin) % 32 ) NAMD_bug("ProxyPatch::receiveAll positionPtrBegin not 32-byte aligned");
00275 #else
00276   p.resize(msg->plLen);
00277   memcpy(p.begin(), msg->positionList, sizeof(CompAtom)*(msg->plLen));
00278 #endif
00279 
00280 // DMK
00281 #if defined(NAMD_CUDA) || defined(NAMD_MIC)
00282   cudaAtomPtr = msg->cudaAtomList;
00283 #endif
00284 
00285   numAtoms = msg->plLen;
00286   //numAtoms = p.size();
00287   
00288   avgPositionPtrBegin = msg->avgPositionList;
00289   avgPositionPtrEnd = msg->avgPositionList + msg->avgPlLen;
00290   
00291   // BEGIN LA
00292   velocityPtrBegin = msg->velocityList;
00293   velocityPtrEnd = msg->velocityList + msg->vlLen;
00294   // END LA
00295 
00296   if (flags.doGBIS) {
00297     intRad.resize(numAtoms*2);
00298     for (int i = 0; i < numAtoms*2;i++) {
00299       intRad[i] = msg->intRadList[i];
00300     }
00301   }
00302 
00303   if (flags.doLCPO) {
00304     lcpoType.resize(numAtoms);
00305     for (int i = 0; i < numAtoms; i++) {
00306       lcpoType[i] = msg->lcpoTypeList[i];
00307     }
00308   }
00309 
00310   //We cannot reuse the CompAtomExt list inside the msg because
00311   //the information is needed at every step. In the current implementation
00312   //scheme, the ProxyDataMsg msg will be deleted for every step.
00313   //In order to keep this information, we have to do the extra copy. But
00314   //this overhead is amortized among the steps that atoms don't migrate
00315   // --Chao Mei
00316   pExt.resize(msg->plExtLen);
00317   memcpy(pExt.begin(), msg->positionExtList, sizeof(CompAtomExt)*(msg->plExtLen));
00318 
00319   // DMK - Atom Separation (water vs. non-water)
00320   #if NAMD_SeparateWaters != 0
00321     numWaterAtoms = msg->numWaterAtoms;
00322   #endif
00323 
00324   positionsReady(1);
00325 }

void ProxyPatch::receiveData ( ProxyGBISP3DataMsg  ) 

Definition at line 519 of file ProxyPatch.C.

References ResizeArray< Elem >::begin(), ProxyGBISP3DataMsg::dHdrPrefix, Patch::dHdrPrefix, ProxyGBISP3DataMsg::dHdrPrefixLen, and Patch::gbisP3Ready().

00519                                                     {
00520   memcpy(dHdrPrefix.begin(), msg->dHdrPrefix, sizeof(Real)*msg->dHdrPrefixLen);
00521   delete msg;
00522   Patch::gbisP3Ready();
00523 }

void ProxyPatch::receiveData ( ProxyGBISP2DataMsg  ) 

Definition at line 513 of file ProxyPatch.C.

References ResizeArray< Elem >::begin(), ProxyGBISP2DataMsg::bornRad, Patch::bornRad, Patch::gbisP2Ready(), and Patch::numAtoms.

00513                                                     {
00514   memcpy(bornRad.begin(), msg->bornRad, sizeof(Real)*numAtoms);
00515   delete msg;
00516   Patch::gbisP2Ready();
00517 }

void ProxyPatch::receiveData ( ProxyDataMsg  ) 

Definition at line 165 of file ProxyPatch.C.

References ProxyDataMsg::avgPlLen, ProxyDataMsg::avgPositionList, Patch::avgPositionPtrBegin, Patch::avgPositionPtrEnd, ResizeArray< Elem >::begin(), Patch::boxesOpen, ProxyDataMsg::cudaAtomList, Patch::cudaAtomPtr, DebugM, ProxyDataMsg::flags, Patch::flags, NAMD_bug(), Patch::numAtoms, Patch::p, Patch::patchID, Patch::pExt, ProxyDataMsg::plExtLen, ProxyDataMsg::plLen, ProxyDataMsg::positionExtList, ProxyDataMsg::positionList, Patch::positionsReady(), PROXYDATAMSGBUFFERED, ResizeArray< Elem >::resize(), ProxyDataMsg::velocityList, Patch::velocityPtrBegin, Patch::velocityPtrEnd, and ProxyDataMsg::vlLen.

Referenced by boxClosed(), ProxyMgr::recvData(), and ProxyMgr::recvProxyData().

00166 {
00167   DebugM(3, "receiveData(" << patchID << ")\n");
00168 
00169   //delete the ProxyDataMsg of the previous step
00170   delete prevProxyMsg;
00171   prevProxyMsg = NULL;
00172 
00173   if ( boxesOpen )
00174   {
00175       proxyMsgBufferStatus = PROXYDATAMSGBUFFERED;
00176     // store message in queue (only need one element, though)
00177     curProxyMsg = msg;
00178     return;
00179   }
00180 
00181   //Reuse position arrays inside proxyDataMsg --Chao Mei
00182   curProxyMsg = msg;
00183   prevProxyMsg = curProxyMsg;
00184   flags = msg->flags;
00185 
00186 #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
00187   if ( ((int64)msg->positionList) % 32 ) { // not aligned
00188     p.resize(msg->plLen);
00189     positionPtrBegin = p.begin();
00190     memcpy(positionPtrBegin, msg->positionList, sizeof(CompAtom)*(msg->plLen));
00191   } else { // aligned
00192     positionPtrBegin = msg->positionList;
00193   }
00194   positionPtrEnd = positionPtrBegin + msg->plLen;
00195   if ( ((int64)positionPtrBegin) % 32 ) NAMD_bug("ProxyPatch::receiveData positionPtrBegin not 32-byte aligned");
00196 #else
00197   p.resize(msg->plLen);
00198   memcpy(p.begin(), msg->positionList, sizeof(CompAtom)*(msg->plLen));
00199 #endif
00200 
00201 // DMK
00202 #if defined(NAMD_CUDA) || defined(NAMD_MIC)
00203   cudaAtomPtr = msg->cudaAtomList;
00204 #endif
00205   
00206   avgPositionPtrBegin = msg->avgPositionList;
00207   avgPositionPtrEnd = msg->avgPositionList + msg->avgPlLen;
00208   
00209   // BEGIN LA
00210   velocityPtrBegin = msg->velocityList;
00211   velocityPtrEnd = msg->velocityList + msg->vlLen;
00212   // END LA
00213 
00214   if ( numAtoms == -1 ) { // for new proxies since receiveAtoms is not called
00215       //numAtoms = p.size();
00216       numAtoms = msg->plLen;
00217 
00218       //Retrieve the CompAtomExt list
00219       CmiAssert(msg->plExtLen!=0);
00220       pExt.resize(msg->plExtLen);
00221       memcpy(pExt.begin(), msg->positionExtList, sizeof(CompAtomExt)*(msg->plExtLen));
00222 
00223 
00224     // DMK - Atom Separation (water vs. non-water)
00225     #if NAMD_SeparateWaters != 0
00226       numWaterAtoms = msg->numWaterAtoms;
00227     #endif
00228 
00229     positionsReady(1);
00230   } else {
00231     positionsReady(0);
00232   }
00233 }

void ProxyPatch::setSpanningTree ( int  ,
int *  ,
int   
)

Definition at line 440 of file ProxyPatch.C.

References Patch::child.

Referenced by ProxyMgr::recvNodeAwareSpanningTree(), ProxyMgr::recvNodeAwareSTParent(), and ProxyMgr::recvSpanningTree().

00440                                                      { 
00441 #if CMK_PERSISTENT_COMM && USE_PERSISTENT_TREE
00442   if (ntreephs!=0) {
00443       for (int i=0; i<ntreephs; i++)  CmiDestoryPersistent(treephs[i]);
00444   }
00445   for (int i=0; i<n; i++) {
00446        treephs[i] = CmiCreatePersistent(c[i], 27000, sizeof(envelope)+sizeof(ProxyDataMsg));
00447   }
00448   ntreephs = n;
00449 #endif
00450   parent=p; nChild = n; nWait = 0;
00451   for (int i=0; i<n; i++) child[i] = c[i];
00452 //CkPrintf("setSpanningTree: [%d:%d] %d %d:%d %d\n", CkMyPe(), patchID, parent, nChild, child[0], child[1]);
00453 }


The documentation for this class was generated from the following files:
Generated on Fri Nov 24 01:17:20 2017 for NAMD by  doxygen 1.4.7