MeshStreamer: Determine location only if data item needs to be transmitted further
authorRamprasad Venkataraman <ramv@illinois.edu>
Fri, 27 Apr 2012 18:34:34 +0000 (13:34 -0500)
committerRamprasad Venkataraman <ramv@illinois.edu>
Fri, 27 Apr 2012 18:34:34 +0000 (13:34 -0500)
src/libs/ck-libs/NDMeshStreamer/NDMeshStreamer.h

index bf881149d0e2ad08486f8711589173da2f4175ea..a3302fa3a45e470795610e0f5bd4485f7ecb4b32 100644 (file)
@@ -475,11 +475,11 @@ void MeshStreamer<dtype>::receiveAlongRoute(MeshStreamerMessage<dtype> *msg) {
   for (int i = 0; i < msg->numDataItems; i++) {
     destinationPe = msg->destinationPes[i];
     dtype &dataItem = msg->getDataItem(i);
-    destinationLocation = determineLocation(destinationPe);
     if (destinationPe == CkMyPe()) {
       localDeliver(dataItem);
     }
     else {
+      destinationLocation = determineLocation(destinationPe);
       storeMessage(destinationPe, destinationLocation, &dataItem);   
     }
   }