| version 1.1042 | version 1.1043 |
|---|
| |
| // 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 |
| |
| 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; |
| |
| //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; |
| |
| | |
| 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 |
| |
| // 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 { |