Difference for src/ProxyPatch.C from version 1.1042 to 1.1043

version 1.1042version 1.1043
Line 54
Line 54
   // it corresponds to no longer exist on this specific processor.   // it corresponds to no longer exist on this specific processor.
   CmiAssert(prevProxyMsg!=NULL);   CmiAssert(prevProxyMsg!=NULL);
   if(prevProxyMsg!=NULL) {   if(prevProxyMsg!=NULL) {
       //AtomMap::Object()->unregisterIDs(patchID,p.begin(),p.end()); #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
       AtomMap::Object()->unregisterIDs(patchID,positionPtrBegin, positionPtrEnd);       AtomMap::Object()->unregisterIDs(patchID,positionPtrBegin, positionPtrEnd);
  #else
        AtomMap::Object()->unregisterIDs(patchID,p.begin(),p.end());
  #endif      
       delete prevProxyMsg;       delete prevProxyMsg;
       prevProxyMsg = NULL;       prevProxyMsg = NULL;
   }   }
  
   delete [] child;   delete [] child;
  
    p.resize(0);
  
 #ifdef MEM_OPT_VERSION #ifdef MEM_OPT_VERSION
   pExt.resize(0);   pExt.resize(0);
 #endif #endif
Line 127
Line 132
   prevProxyMsg = curProxyMsg;   prevProxyMsg = curProxyMsg;
   flags = msg->flags;   flags = msg->flags;
      
  #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
   //We could set them to 0 for the sake of easy debugging   //We could set them to 0 for the sake of easy debugging
   //if there are something wrong in the "reuse position arrays" code   //if there are something wrong in the "reuse position arrays" code
   //--Chao Mei   //--Chao Mei
   //p.resize(0);   //p.resize(0);
   //p_avg.resize(0);   //p_avg.resize(0);
    
   positionPtrBegin = msg->positionList;   positionPtrBegin = msg->positionList;
   positionPtrEnd = msg->positionList + msg->plLen;   positionPtrEnd = msg->positionList + msg->plLen;
  #else
    p.resize(msg->plLen);
    memcpy(p.begin(), msg->positionList, sizeof(CompAtom)*(msg->plLen));
  #endif
  
   avgPositionPtrBegin = msg->avgPositionList;   avgPositionPtrBegin = msg->avgPositionList;
   avgPositionPtrEnd = msg->avgPositionList + msg->avgPlLen;   avgPositionPtrEnd = msg->avgPositionList + msg->avgPlLen;
Line 177
Line 186
   //The prevProxyMsg has to be deleted after this if-statement because   //The prevProxyMsg has to be deleted after this if-statement because
   // positionPtrBegin points to the space inside the prevProxyMsg   // positionPtrBegin points to the space inside the prevProxyMsg
   if(prevProxyMsg!=NULL) {   if(prevProxyMsg!=NULL) {
  #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
       AtomMap::Object()->unregisterIDs(patchID,positionPtrBegin,positionPtrEnd);       AtomMap::Object()->unregisterIDs(patchID,positionPtrBegin,positionPtrEnd);
  #else
        AtomMap::Object()->unregisterIDs(patchID, p.begin(), p.end());
  #endif
   }   }
   //Now delete the ProxyDataMsg of the previous step   //Now delete the ProxyDataMsg of the previous step
   delete prevProxyMsg;   delete prevProxyMsg;
Line 186
Line 199
  
   flags = msg->flags;   flags = msg->flags;
  
  #ifdef REMOVE_PROXYDATAMSG_EXTRACOPY
    //We could set them to 0 for the sake of easy debugging
    //if there are something wrong in the "reuse position arrays" code
    //--Chao Mei
    //p.resize(0);
    //p_avg.resize(0);  
   positionPtrBegin = msg->positionList;   positionPtrBegin = msg->positionList;
   positionPtrEnd = msg->positionList + msg->plLen;   positionPtrEnd = msg->positionList + msg->plLen;
  #else
    p.resize(msg->plLen);
    memcpy(p.begin(), msg->positionList, sizeof(CompAtom)*(msg->plLen));
  #endif
  
   numAtoms = msg->plLen;   numAtoms = msg->plLen;
   //numAtoms = p.size();   //numAtoms = p.size();
      
   avgPositionPtrBegin = msg->avgPositionList;   avgPositionPtrBegin = msg->avgPositionList;
   avgPositionPtrEnd = msg->avgPositionList + msg->avgPlLen;   avgPositionPtrEnd = msg->avgPositionList + msg->avgPlLen;
  
   //We could set them to 0 for the sake of easy debugging 
   //if there are something wrong in the "reuse position arrays" code 
   //--Chao Mei 
   p.resize(0); 
   p_avg.resize(0); 
  
 #ifdef MEM_OPT_VERSION #ifdef MEM_OPT_VERSION
   //We cannot reuse the CompAtomExt list inside the msg because   //We cannot reuse the CompAtomExt list inside the msg because
   //the information is needed at every step. In the current implementation   //the information is needed at every step. In the current implementation
Line 237
Line 255
 //  CmiUsePersistentHandle(&localphs, 1); //  CmiUsePersistentHandle(&localphs, 1);
 #endif #endif
   if (proxyRecvSpanning == 0) {   if (proxyRecvSpanning == 0) {
  #ifdef REMOVE_PROXYRESULTMSG_EXTRACOPY
      ProxyResultVarsizeMsg *msg = ProxyResultVarsizeMsg::getANewMsg(CkMyPe(), patchID, PRIORITY_SIZE, f);   
  #else
     ProxyResultMsg *msg = new (PRIORITY_SIZE) ProxyResultMsg;     ProxyResultMsg *msg = new (PRIORITY_SIZE) ProxyResultMsg;
     SET_PRIORITY(msg,flags.sequence, 
  PROXY_RESULTS_PRIORITY + PATCH_PRIORITY(patchID)); 
     msg->node = CkMyPe();     msg->node = CkMyPe();
     msg->patch = patchID;     msg->patch = patchID;
     for ( i = 0; i < Results::maxNumForces; ++i )      for ( i = 0; i < Results::maxNumForces; ++i ) 
       msg->forceList[i] = f[i];       msg->forceList[i] = f[i];
  #endif
      SET_PRIORITY(msg,flags.sequence,PROXY_RESULTS_PRIORITY + PATCH_PRIORITY(patchID));
     ProxyMgr::Object()->sendResults(msg);     ProxyMgr::Object()->sendResults(msg);
   }   }
   else {   else {


Legend:
Removed in v.1.1042 
changed lines
 Added in v.1.1043



Made by using version 1.53 of cvs2html