Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case LinkImpl (but the part that should to the engine)
[simgrid.git] / src / kernel / routing / FatTreeZone.cpp
index 2c59ed9..6101508 100644 (file)
@@ -58,31 +58,31 @@ bool FatTreeZone::isInSubTree(FatTreeNode* root, FatTreeNode* node)
   return true;
 }
 
-void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency)
+void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency)
 {
 
-  if (dst->isRouter() || src->isRouter())
+  if (dst->is_router() || src->is_router())
     return;
 
   /* Let's find the source and the destination in our internal structure */
   auto searchedNode = this->compute_nodes_.find(src->id());
   xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the source %s [%u] in the fat tree",
-             src->getCname(), src->id());
+             src->get_cname(), src->id());
   FatTreeNode* source = searchedNode->second;
 
   searchedNode = this->compute_nodes_.find(dst->id());
   xbt_assert(searchedNode != this->compute_nodes_.end(), "Could not find the destination %s [%u] in the fat tree",
-             dst->getCname(), dst->id());
+             dst->get_cname(), dst->id());
   FatTreeNode* destination = searchedNode->second;
 
-  XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->getCname(), src->id(),
-           dst->getCname(), dst->id());
+  XBT_VERB("Get route and latency from '%s' [%u] to '%s' [%u] in a fat tree", src->get_cname(), src->id(),
+           dst->get_cname(), dst->id());
 
   /* 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 && this->has_loopback_) {
     into->link_list.push_back(source->loopback);
     if (latency)
-      *latency += source->loopback->latency();
+      *latency += source->loopback->get_latency();
     return;
   }
 
@@ -100,7 +100,7 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs*
     into->link_list.push_back(currentNode->parents[d]->up_link_);
 
     if (latency)
-      *latency += currentNode->parents[d]->up_link_->latency();
+      *latency += currentNode->parents[d]->up_link_->get_latency();
 
     if (this->has_limiter_)
       into->link_list.push_back(currentNode->limiter_link_);
@@ -116,7 +116,7 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs*
       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_);
         if (latency)
-          *latency += currentNode->children[i]->down_link_->latency();
+          *latency += currentNode->children[i]->down_link_->get_latency();
         currentNode = currentNode->children[i]->down_node_;
         if (this->has_limiter_)
           into->link_list.push_back(currentNode->limiter_link_);
@@ -190,8 +190,8 @@ int FatTreeZone::connectNodeToParents(FatTreeNode* node)
                 node->id, node->level, node->position, (*currentParentNode)->id, (*currentParentNode)->level,
                 (*currentParentNode)->position, this->num_port_lower_level_[level]);
       for (unsigned int j = 0; j < this->num_port_lower_level_[level]; j++) {
-        this->addLink(*currentParentNode, node->label[level] + j * this->num_children_per_node_[level], node,
-                      (*currentParentNode)->label[level] + j * this->num_parents_per_node_[level]);
+        this->add_link(*currentParentNode, node->label[level] + j * this->num_children_per_node_[level], node,
+                       (*currentParentNode)->label[level] + j * this->num_parents_per_node_[level]);
       }
       connectionsNumber++;
     }
@@ -346,7 +346,7 @@ void FatTreeZone::add_processing_node(int id)
   this->nodes_.push_back(newNode);
 }
 
-void FatTreeZone::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeNode* child, unsigned int childPort)
+void FatTreeZone::add_link(FatTreeNode* parent, unsigned int parentPort, FatTreeNode* child, unsigned int childPort)
 {
   FatTreeLink* newLink;
   newLink = new FatTreeLink(this->cluster_, child, parent);
@@ -447,18 +447,18 @@ FatTreeNode::FatTreeNode(ClusterCreationArgs* cluster, int id, int level, int po
   if (cluster->limiter_link) {
     linkTemplate.bandwidth = cluster->limiter_link;
     linkTemplate.latency   = 0;
-    linkTemplate.policy    = SURF_LINK_SHARED;
+    linkTemplate.policy    = s4u::Link::SharingPolicy::SHARED;
     linkTemplate.id        = "limiter_"+std::to_string(id);
     sg_platf_new_link(&linkTemplate);
-    this->limiter_link_ = surf::LinkImpl::byName(linkTemplate.id);
+    this->limiter_link_ = resource::LinkImpl::by_name(linkTemplate.id);
   }
   if (cluster->loopback_bw || cluster->loopback_lat) {
     linkTemplate.bandwidth = cluster->loopback_bw;
     linkTemplate.latency   = cluster->loopback_lat;
-    linkTemplate.policy    = SURF_LINK_FATPIPE;
+    linkTemplate.policy    = s4u::Link::SharingPolicy::FATPIPE;
     linkTemplate.id        = "loopback_"+ std::to_string(id);
     sg_platf_new_link(&linkTemplate);
-    this->loopback = surf::LinkImpl::byName(linkTemplate.id);
+    this->loopback = resource::LinkImpl::by_name(linkTemplate.id);
   }
 }
 
@@ -474,13 +474,13 @@ FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, Fa
       "link_from_" + std::to_string(downNode->id) + "_" + std::to_string(upNode->id) + "_" + std::to_string(uniqueId);
   sg_platf_new_link(&linkTemplate);
 
-  if (cluster->sharing_policy == SURF_LINK_SPLITDUPLEX) {
+  if (cluster->sharing_policy == s4u::Link::SharingPolicy::SPLITDUPLEX) {
     std::string tmpID = std::string(linkTemplate.id) + "_UP";
-    this->up_link_    = surf::LinkImpl::byName(tmpID); // check link?
+    this->up_link_    = resource::LinkImpl::by_name(tmpID); // check link?
     tmpID          = std::string(linkTemplate.id) + "_DOWN";
-    this->down_link_  = surf::LinkImpl::byName(tmpID); // check link ?
+    this->down_link_  = resource::LinkImpl::by_name(tmpID); // check link ?
   } else {
-    this->up_link_   = surf::LinkImpl::byName(linkTemplate.id);
+    this->up_link_   = resource::LinkImpl::by_name(linkTemplate.id);
     this->down_link_ = this->up_link_;
   }
   uniqueId++;