Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use std::pair instead of s_surf_parsing_link_up_down_t for Cluster private links
[simgrid.git] / src / kernel / routing / AsClusterDragonfly.cpp
index 9fb2d04..355c17d 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/kernel/routing/AsClusterDragonfly.hpp"
+#include "src/kernel/routing/NetCard.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
 
@@ -248,12 +249,12 @@ void AsClusterDragonfly::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_rout
            dst->id());
 
   if ((src->id() == dst->id()) && hasLoopback_) {
-     s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id() * linkCountPerNode_);
+    std::pair<Link*, Link*> info = privateLinks_.at(src->id() * linkCountPerNode_);
 
-     route->link_list->push_back(info.linkUp);
-     if (latency)
-       *latency += info.linkUp->latency();
-     return;
+    route->link_list->push_back(info.first);
+    if (latency)
+      *latency += info.first->latency();
+    return;
   }
 
   unsigned int *myCoords = rankId_to_coords(src->id());
@@ -271,8 +272,8 @@ void AsClusterDragonfly::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_rout
     *latency += myRouter->myNodes_[myCoords[3] * numLinksperLink_]->latency();
 
   if (hasLimiter_) {    // limiter for sender
-    s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id() * linkCountPerNode_ + hasLoopback_);
-    route->link_list->push_back(info.linkUp);
+    std::pair<Link*, Link*> info = privateLinks_.at(src->id() * linkCountPerNode_ + hasLoopback_);
+    route->link_list->push_back(info.first);
   }
 
   if(targetRouter!=myRouter){
@@ -322,8 +323,8 @@ void AsClusterDragonfly::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_rout
   }
 
   if (hasLimiter_) {    // limiter for receiver
-    s_surf_parsing_link_up_down_t info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_);
-    route->link_list->push_back(info.linkUp);
+    std::pair<Link*, Link*> info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_);
+    route->link_list->push_back(info.first);
   }
 
   //router->node local link