X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9caf173e476622d309cc5653a83d224d05787cc7..d7137248837c462e9a20c5640f2c74541faa7ef5:/src/kernel/routing/FatTreeZone.cpp diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index e81439a927..6101508561 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -58,10 +58,10 @@ 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 */ @@ -82,7 +82,7 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* 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++;