X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/88fad0aaff9eb463f048bfdfe4ad6218aba44ddb..dd05e77cf9fe231aef1608d42c8e45ac3ee5c15c:/src/kernel/routing/FatTreeZone.cpp diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 2c59ed92b6..e777ccf153 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -58,25 +58,25 @@ 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_) { @@ -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::byName(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::byName(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::byName(tmpID); // check link? tmpID = std::string(linkTemplate.id) + "_DOWN"; - this->down_link_ = surf::LinkImpl::byName(tmpID); // check link ? + this->down_link_ = resource::LinkImpl::byName(tmpID); // check link ? } else { - this->up_link_ = surf::LinkImpl::byName(linkTemplate.id); + this->up_link_ = resource::LinkImpl::byName(linkTemplate.id); this->down_link_ = this->up_link_; } uniqueId++;