X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fa159d28bf7eb7b7876fbd85ea11a8d74cf489fc..9caf173e476622d309cc5653a83d224d05787cc7:/src/kernel/routing/NetZoneImpl.cpp diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 3597560dab..2ec532bb14 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -37,7 +37,7 @@ NetZoneImpl::NetZoneImpl(NetZone* father, std::string name) : NetZone(father, na NetZoneImpl::~NetZoneImpl() { - for (auto const& kv : bypassRoutes_) + for (auto const& kv : bypass_routes_) delete kv.second; simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_); @@ -69,19 +69,19 @@ void NetZoneImpl::addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, { /* Argument validity checks */ if (gw_dst) { - XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->getCname(), gw_src->getCname(), dst->getCname(), - gw_dst->getCname()); - xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->getCname(), - gw_src->getCname(), dst->getCname(), gw_dst->getCname()); - xbt_assert(bypassRoutes_.find({src, dst}) == bypassRoutes_.end(), - "The bypass route between %s@%s and %s@%s already exists.", src->getCname(), gw_src->getCname(), - dst->getCname(), gw_dst->getCname()); + XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->get_cname(), gw_src->get_cname(), dst->get_cname(), + gw_dst->get_cname()); + xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(), + gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname()); + xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(), + "The bypass route between %s@%s and %s@%s already exists.", src->get_cname(), gw_src->get_cname(), + dst->get_cname(), gw_dst->get_cname()); } else { - XBT_DEBUG("Load bypassRoute from %s to %s", src->getCname(), dst->getCname()); - xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->getCname(), - dst->getCname()); - xbt_assert(bypassRoutes_.find({src, dst}) == bypassRoutes_.end(), - "The bypass route between %s and %s already exists.", src->getCname(), dst->getCname()); + XBT_DEBUG("Load bypassRoute from %s to %s", src->get_cname(), dst->get_cname()); + xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(), + dst->get_cname()); + xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(), + "The bypass route between %s and %s already exists.", src->get_cname(), dst->get_cname()); } /* Build a copy that will be stored in the dict */ @@ -90,7 +90,7 @@ void NetZoneImpl::addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, newRoute->links.push_back(link); /* Store it */ - bypassRoutes_.insert({{src, dst}, newRoute}); + bypass_routes_.insert({{src, dst}, newRoute}); } /** @brief Get the common ancestor and its first children in each line leading to src and dst @@ -161,8 +161,8 @@ static void find_common_ancestors(NetPoint* src, NetPoint* dst, NetZoneImpl* src_as = src->netzone(); NetZoneImpl* dst_as = dst->netzone(); - xbt_assert(src_as, "Host %s must be in a netzone", src->getCname()); - xbt_assert(dst_as, "Host %s must be in a netzone", dst->getCname()); + xbt_assert(src_as, "Host %s must be in a netzone", src->get_cname()); + xbt_assert(dst_as, "Host %s must be in a netzone", dst->get_cname()); /* (2) find the path to the root routing component */ std::vector path_src; @@ -207,19 +207,19 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, /* OUT */ std::vector& links, double* latency) { // If never set a bypass route return nullptr without any further computations - if (bypassRoutes_.empty()) + if (bypass_routes_.empty()) return false; /* Base case, no recursion is needed */ if (dst->netzone() == this && src->netzone() == this) { - if (bypassRoutes_.find({src, dst}) != bypassRoutes_.end()) { - BypassRoute* bypassedRoute = bypassRoutes_.at({src, dst}); + if (bypass_routes_.find({src, dst}) != bypass_routes_.end()) { + BypassRoute* bypassedRoute = bypass_routes_.at({src, dst}); for (surf::LinkImpl* const& link : bypassedRoute->links) { links.push_back(link); if (latency) *latency += link->latency(); } - XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->getCname(), dst->getCname(), + XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->get_cname(), dst->get_cname(), bypassedRoute->links.size()); return true; } @@ -262,16 +262,16 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, for (int i = 0; i < max; i++) { if (i <= max_index_src && max <= max_index_dst) { key = {path_src.at(i)->netpoint_, path_dst.at(max)->netpoint_}; - auto bpr = bypassRoutes_.find(key); - if (bpr != bypassRoutes_.end()) { + auto bpr = bypass_routes_.find(key); + if (bpr != bypass_routes_.end()) { bypassedRoute = bpr->second; break; } } if (max <= max_index_src && i <= max_index_dst) { key = {path_src.at(max)->netpoint_, path_dst.at(i)->netpoint_}; - auto bpr = bypassRoutes_.find(key); - if (bpr != bypassRoutes_.end()) { + auto bpr = bypass_routes_.find(key); + if (bpr != bypass_routes_.end()) { bypassedRoute = bpr->second; break; } @@ -283,8 +283,8 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, if (max <= max_index_src && max <= max_index_dst) { key = {path_src.at(max)->netpoint_, path_dst.at(max)->netpoint_}; - auto bpr = bypassRoutes_.find(key); - if (bpr != bypassRoutes_.end()) { + auto bpr = bypass_routes_.find(key); + if (bpr != bypass_routes_.end()) { bypassedRoute = bpr->second; break; } @@ -295,7 +295,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, if (bypassedRoute) { XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links. We may have to complete it with recursive " "calls to getRoute", - src->getCname(), dst->getCname(), bypassedRoute->links.size()); + src->get_cname(), dst->get_cname(), bypassedRoute->links.size()); if (src != key.first) getGlobalRoute(src, bypassedRoute->gw_src, links, latency); for (surf::LinkImpl* const& link : bypassedRoute->links) { @@ -307,7 +307,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, getGlobalRoute(bypassedRoute->gw_dst, dst, links, latency); return true; } - XBT_DEBUG("No bypass route from '%s' to '%s'.", src->getCname(), dst->getCname()); + XBT_DEBUG("No bypass route from '%s' to '%s'.", src->get_cname(), dst->get_cname()); return false; } @@ -316,15 +316,15 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, { RouteCreationArgs route; - XBT_DEBUG("Resolve route from '%s' to '%s'", src->getCname(), dst->getCname()); + XBT_DEBUG("Resolve route from '%s' to '%s'", src->get_cname(), dst->get_cname()); /* Find how src and dst are interconnected */ NetZoneImpl *common_ancestor; NetZoneImpl *src_ancestor; NetZoneImpl *dst_ancestor; find_common_ancestors(src, dst, &common_ancestor, &src_ancestor, &dst_ancestor); - XBT_DEBUG("elements_father: common ancestor '%s' src ancestor '%s' dst ancestor '%s'", common_ancestor->getCname(), - src_ancestor->getCname(), dst_ancestor->getCname()); + XBT_DEBUG("elements_father: common ancestor '%s' src ancestor '%s' dst ancestor '%s'", common_ancestor->get_cname(), + src_ancestor->get_cname(), dst_ancestor->get_cname()); /* Check whether a direct bypass is defined. If so, use it and bail out */ if (common_ancestor->getBypassRoute(src, dst, links, latency)) @@ -342,7 +342,7 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, common_ancestor->getLocalRoute(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency); xbt_assert((route.gw_src != nullptr) && (route.gw_dst != nullptr), "bad gateways for route from \"%s\" to \"%s\"", - src->getCname(), dst->getCname()); + src->get_cname(), dst->get_cname()); /* If source gateway is not our source, we have to recursively find our way up to this point */ if (src != route.gw_src)