Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
do not use RouteCreationArgs outside of XML parsing
[simgrid.git] / src / kernel / routing / FatTreeZone.cpp
index 5613a21..b7df0d1 100644 (file)
@@ -51,7 +51,7 @@ bool FatTreeZone::is_in_sub_tree(FatTreeNode* root, FatTreeNode* node) const
   return true;
 }
 
-void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency)
+void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency)
 {
   if (dst->is_router() || src->is_router())
     return;
@@ -72,7 +72,7 @@ void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
 
   /* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */
   if (source->id == destination->id && has_loopback()) {
-    into->link_list.push_back(source->loopback_);
+    into->link_list_.push_back(source->loopback_);
     if (latency)
       *latency += source->loopback_->get_latency();
     return;
@@ -89,13 +89,13 @@ void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
 
     int k = this->num_parents_per_node_[currentNode->level];
     d     = d % k;
-    into->link_list.push_back(currentNode->parents[d]->up_link_);
+    into->link_list_.push_back(currentNode->parents[d]->up_link_);
 
     if (latency)
       *latency += currentNode->parents[d]->up_link_->get_latency();
 
     if (currentNode->limiter_link_)
-      into->link_list.push_back(currentNode->limiter_link_);
+      into->link_list_.push_back(currentNode->limiter_link_);
     currentNode = currentNode->parents[d]->up_node_;
   }
 
@@ -106,20 +106,20 @@ void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArg
   while (currentNode != destination) {
     for (unsigned int i = 0; i < currentNode->children.size(); i++) {
       if (i % this->num_children_per_node_[currentNode->level - 1] == destination->label[currentNode->level - 1]) {
-        into->link_list.push_back(currentNode->children[i]->down_link_);
+        into->link_list_.push_back(currentNode->children[i]->down_link_);
         if (latency)
           *latency += currentNode->children[i]->down_link_->get_latency();
         currentNode = currentNode->children[i]->down_node_;
         if (currentNode->limiter_link_)
-          into->link_list.push_back(currentNode->limiter_link_);
+          into->link_list_.push_back(currentNode->limiter_link_);
         XBT_DEBUG("%d(%u,%u) is accessible through %d(%u,%u)", destination->id, destination->level,
                   destination->position, currentNode->id, currentNode->level, currentNode->position);
       }
     }
   }
   // set gateways (if any)
-  into->gw_src = get_gateway(src->id());
-  into->gw_dst = get_gateway(dst->id());
+  into->gw_src_ = get_gateway(src->id());
+  into->gw_dst_ = get_gateway(dst->id());
 }
 
 /* This function makes the assumption that parse_specific_arguments() and
@@ -346,11 +346,13 @@ void FatTreeZone::add_link(FatTreeNode* parent, unsigned int parentPort, FatTree
   std::string id =
       "link_from_" + std::to_string(child->id) + "_" + std::to_string(parent->id) + "_" + std::to_string(uniqueId);
 
-  if (link_sharing_policy_ == s4u::Link::SharingPolicy::SPLITDUPLEX) {
-    linkup   = create_link(id + "_UP", std::vector<double>{link_bw_})->set_latency(link_lat_)->seal();
-    linkdown = create_link(id + "_DOWN", std::vector<double>{link_bw_})->set_latency(link_lat_)->seal();
+  if (get_link_sharing_policy() == s4u::Link::SharingPolicy::SPLITDUPLEX) {
+    linkup =
+        create_link(id + "_UP", std::vector<double>{get_link_bandwidth()})->set_latency(get_link_latency())->seal();
+    linkdown =
+        create_link(id + "_DOWN", std::vector<double>{get_link_bandwidth()})->set_latency(get_link_latency())->seal();
   } else {
-    linkup   = create_link(id, std::vector<double>{link_bw_})->set_latency(link_lat_)->seal();
+    linkup   = create_link(id, std::vector<double>{get_link_bandwidth()})->set_latency(get_link_latency())->seal();
     linkdown = linkup;
   }
   uniqueId++;
@@ -388,13 +390,6 @@ void FatTreeZone::check_topology(unsigned int n_levels, const std::vector<unsign
   check_vector(link_count, "link count");
 }
 
-void FatTreeZone::set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy)
-{
-  link_sharing_policy_ = sharing_policy;
-  link_bw_             = bw;
-  link_lat_            = lat;
-}
-
 void FatTreeZone::set_topology(unsigned int n_levels, const std::vector<unsigned int>& down_links,
                                const std::vector<unsigned int>& up_links, const std::vector<unsigned int>& link_count)
 {