Information about local vs remote communications
authorHarshitha <gplkrsh2@illinois.edu>
Mon, 2 Apr 2012 19:54:40 +0000 (14:54 -0500)
committerHarshitha <gplkrsh2@illinois.edu>
Mon, 2 Apr 2012 19:54:40 +0000 (14:54 -0500)
src/ck-ldb/CommAwareRefineLB.C
src/ck-ldb/MetisLB.C

index 977cc5aef682ee4cae40cb525938f7e2e8f05707..338a21e120280392264b4582ce2491099013dc4d 100644 (file)
@@ -344,6 +344,25 @@ void CommAwareRefineLB::work(LDStats* stats)
       }
     }
 
+  int local_comm = 0;
+  int remote_comm = 0;
+  for (int i=0; i< ogr->vertices.size(); i++) {
+    for(int j = 0; j < ogr->vertices[i].sendToList.size(); j++) {
+      vert = ogr->vertices[i].sendToList[j].getNeighborId();
+      if(ogr->vertices[i].getNewPe() == ogr->vertices[vert].getNewPe()) {
+        local_comm++;
+      } else {
+        remote_comm++;
+      }
+    }
+  }
+  CkPrintf("Local communication: %d Remote communication: %d\n", local_comm, remote_comm);
+  stats->local_comm = local_comm;
+  stats->remote_comm = remote_comm;
+
+  stats->is_prev_lb_refine = 3;
+  stats->after_lb_max = 0;
+  stats->after_lb_avg = 0;
 
   /** ============================== CLEANUP ================================ */
   ogr->convertDecisions(stats);         // Send decisions back to LDStats
index 6061cd0c5c825da32e0931299074358cc0529259..5dc99cc959fb4a5c1ca390bb5e7d18aa8a4f073a 100644 (file)
@@ -172,7 +172,24 @@ void MetisLB::work(LDStats* stats)
     if(pemap[i] != ogr->vertices[i].getCurrentPe())
       ogr->vertices[i].setNewPe(pemap[i]);
   }
-  stats->is_prev_lb_refine = 3;
+
+  int local_comm = 0;
+  int remote_comm = 0;
+  for (int i=0; i< numVertices; i++) {
+    for(int j = 0; j < ogr->vertices[i].sendToList.size(); j++) {
+      vert = ogr->vertices[i].sendToList[j].getNeighborId();
+      if(pemap[i] == pemap[vert]) {
+        local_comm++;
+      } else {
+        remote_comm++;
+      }
+    }
+  }
+  CkPrintf("Local communication: %d Remote communication: %d\n", local_comm, remote_comm);
+  stats->local_comm = local_comm;
+  stats->remote_comm = remote_comm;
+
+  stats->is_prev_lb_refine = 2;
   stats->after_lb_max = 0;
   stats->after_lb_avg = 0;