X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e18a7b043d161b29d0bf3f5743cb7a570241576a..ecd5f7562caf1d443bf22788fa5f4fac408776ec:/src/kernel/routing/TorusZone.cpp diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index b3b83dfac4..c9d1636772 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -31,7 +31,7 @@ TorusZone::TorusZone(NetZone* father, std::string name) : ClusterZone(father, na { } -void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, int position) +void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) { /* Create all links that exist in the torus. Each rank creates @a dimensions-1 links */ int dim_product = 1; // Needed to calculate the next neighbor_id @@ -64,8 +64,8 @@ void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int linkDown = linkUp; } /* - * Add the link to its appropriate position; - * note that position rankId*(xbt_dynar_length(dimensions)+has_loopback?+has_limiter?) + * Add the link to its appropriate position. + * Note that position rankId*(xbt_dynar_length(dimensions)+has_loopback?+has_limiter?) * holds the link "rankId->rankId" */ privateLinks_.insert({position + j, {linkUp, linkDown}}); @@ -94,8 +94,7 @@ void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster) void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat) { - XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(), - dst->id()); + XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->getCname(), src->id(), dst->getCname(), dst->id()); if (dst->isRouter() || src->isRouter()) return; @@ -103,7 +102,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg if (src->id() == dst->id() && hasLoopback_) { std::pair info = privateLinks_.at(src->id() * linkCountPerNode_); - route->link_list->push_back(info.first); + route->link_list.push_back(info.first); if (lat) *lat += info.first->latency(); return; @@ -179,18 +178,18 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg std::pair info; if (hasLimiter_) { // limiter for sender - info = privateLinks_.at(nodeOffset + hasLoopback_); - route->link_list->push_back(info.first); + info = privateLinks_.at(nodeOffset + (hasLoopback_ ? 1 : 0)); + route->link_list.push_back(info.first); } info = privateLinks_.at(linkOffset); if (use_lnk_up == false) { - route->link_list->push_back(info.second); + route->link_list.push_back(info.second); if (lat) *lat += info.second->latency(); } else { - route->link_list->push_back(info.first); + route->link_list.push_back(info.first); if (lat) *lat += info.first->latency(); }