From: Martin Quinson Date: Mon, 2 Apr 2018 21:16:46 +0000 (+0200) Subject: further snake_case in routing X-Git-Tag: v3.20~551 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c139b4e36702f58bd8a75e87cf537959da82dbc9 further snake_case in routing --- diff --git a/include/simgrid/kernel/routing/ClusterZone.hpp b/include/simgrid/kernel/routing/ClusterZone.hpp index f44aba36b0..3ac701161a 100644 --- a/include/simgrid/kernel/routing/ClusterZone.hpp +++ b/include/simgrid/kernel/routing/ClusterZone.hpp @@ -70,8 +70,8 @@ public: explicit ClusterZone(NetZone* father, std::string name); void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; - void getGraph(xbt_graph_t graph, std::map* nodes, - std::map* edges) override; + void get_graph(xbt_graph_t graph, std::map* nodes, + std::map* edges) override; virtual void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position); virtual void parse_specific_arguments(ClusterCreationArgs* cluster) diff --git a/include/simgrid/kernel/routing/EmptyZone.hpp b/include/simgrid/kernel/routing/EmptyZone.hpp index cb64ff5ed5..d92f0c09e3 100644 --- a/include/simgrid/kernel/routing/EmptyZone.hpp +++ b/include/simgrid/kernel/routing/EmptyZone.hpp @@ -29,8 +29,8 @@ public: /* There can't be route in an Empty zone */ } - void getGraph(xbt_graph_t graph, std::map* /*nodes*/, - std::map* /*edges*/) override; + void get_graph(xbt_graph_t graph, std::map* /*nodes*/, + std::map* /*edges*/) override; }; } // namespace routing } // namespace kernel diff --git a/include/simgrid/kernel/routing/NetZoneImpl.hpp b/include/simgrid/kernel/routing/NetZoneImpl.hpp index dbcde250a3..854b1f0181 100644 --- a/include/simgrid/kernel/routing/NetZoneImpl.hpp +++ b/include/simgrid/kernel/routing/NetZoneImpl.hpp @@ -55,11 +55,11 @@ protected: public: /** @brief Make an host within that NetZone */ - simgrid::s4u::Host* createHost(const char* name, std::vector* speedPerPstate, int coreAmount, - std::map* props); + simgrid::s4u::Host* create_host(const char* name, std::vector* speedPerPstate, int coreAmount, + std::map* props); /** @brief Creates a new route in this NetZone */ - void addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical) override; + void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, + std::vector& link_list, bool symmetrical) override; protected: /** @@ -73,8 +73,8 @@ protected: virtual void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) = 0; /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */ /* returns whether we found a bypass path */ - bool getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, - /* OUT */ std::vector& links, double* latency); + bool get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst, + /* OUT */ std::vector& links, double* latency); public: /* @brief get the route between two nodes in the full platform @@ -84,11 +84,11 @@ public: * @param links Accumulator in which all traversed links should be pushed (caller must empty it) * @param latency Accumulator in which the latencies should be added (caller must set it to 0) */ - static void getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, - /* OUT */ std::vector& links, double* latency); + static void get_global_route(routing::NetPoint* src, routing::NetPoint* dst, + /* OUT */ std::vector& links, double* latency); - virtual void getGraph(xbt_graph_t graph, std::map* nodes, - std::map* edges) = 0; + virtual void get_graph(xbt_graph_t graph, std::map* nodes, + std::map* edges) = 0; enum class RoutingMode { unset = 0, /**< Undefined type */ base, /**< Base case: use simple link lists for routing */ diff --git a/include/simgrid/kernel/routing/RoutedZone.hpp b/include/simgrid/kernel/routing/RoutedZone.hpp index efe37297ae..81d7c43afd 100644 --- a/include/simgrid/kernel/routing/RoutedZone.hpp +++ b/include/simgrid/kernel/routing/RoutedZone.hpp @@ -52,8 +52,8 @@ class XBT_PRIVATE RoutedZone : public NetZoneImpl { public: explicit RoutedZone(NetZone* father, std::string name); - void getGraph(xbt_graph_t graph, std::map* nodes, - std::map* edges) override; + void get_graph(xbt_graph_t graph, std::map* nodes, + std::map* edges) override; virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, std::vector& link_list, bool symmetrical, bool change_order); diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index da36a0326c..defe0cab0c 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -63,9 +63,9 @@ public: virtual void addRoute(kernel::routing::NetPoint * src, kernel::routing::NetPoint * dst, kernel::routing::NetPoint * gw_src, kernel::routing::NetPoint * gw_dst, std::vector & link_list, bool symmetrical); - virtual void addBypassRoute(kernel::routing::NetPoint * src, kernel::routing::NetPoint * dst, - kernel::routing::NetPoint * gw_src, kernel::routing::NetPoint * gw_dst, - std::vector & link_list, bool symmetrical) = 0; + virtual void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst, + kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst, + std::vector& link_list, bool symmetrical) = 0; /*** Called on each newly created regular route (not on bypass routes) */ static simgrid::xbt::signal route; - simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, route, nullptr); + simgrid::kernel::routing::NetZoneImpl::get_global_route(src_elm, dst_elm, route, nullptr); for (auto const& link : route) instr_user_variable(time, link->get_cname(), variable, father_type, value, what, nullptr, &user_link_variables); } diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index f8bfb2e51a..5b2f74c471 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -72,8 +72,8 @@ void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* } } -void ClusterZone::getGraph(xbt_graph_t graph, std::map* nodes, - std::map* edges) +void ClusterZone::get_graph(xbt_graph_t graph, std::map* nodes, + std::map* edges) { xbt_assert(router_, "Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph."); diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 42a622ccfb..71715cd179 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -232,7 +232,7 @@ void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs NetPoint* gw_dst_net_elm = nullptr; NetPoint* prev_gw_src_net_elm = nullptr; - getGlobalRoute(gw_dst_net_elm, prev_gw_src_net_elm, e_route_as_to_as, nullptr); + get_global_route(gw_dst_net_elm, prev_gw_src_net_elm, e_route_as_to_as, nullptr); auto pos = route->link_list.begin(); for (auto const& link : e_route_as_to_as) { route->link_list.insert(pos, link); diff --git a/src/kernel/routing/EmptyZone.cpp b/src/kernel/routing/EmptyZone.cpp index 8615cfdaca..78a1c677ff 100644 --- a/src/kernel/routing/EmptyZone.cpp +++ b/src/kernel/routing/EmptyZone.cpp @@ -21,8 +21,8 @@ EmptyZone::EmptyZone(NetZone* father, std::string name) : NetZoneImpl(father, na EmptyZone::~EmptyZone() = default; -void EmptyZone::getGraph(xbt_graph_t /*graph*/, std::map* /*nodes*/, - std::map* /*edges*/) +void EmptyZone::get_graph(xbt_graph_t /*graph*/, std::map* /*nodes*/, + std::map* /*edges*/) { XBT_ERROR("No routing no graph"); } diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 63214ee3a6..2e9732e88f 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -72,7 +72,7 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* r route_stack.pop_back(); if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr && prev_dst_gw->get_cname() != e_route->gw_src->get_cname()) { - getGlobalRoute(prev_dst_gw, e_route->gw_src, route->link_list, lat); + get_global_route(prev_dst_gw, e_route->gw_src, route->link_list, lat); } for (auto const& link : e_route->link_list) { diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 35c07ef008..bbff2db92f 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -43,8 +43,8 @@ NetZoneImpl::~NetZoneImpl() simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_); } -simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector* speedPerPstate, int coreAmount, - std::map* props) +simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector* speedPerPstate, int coreAmount, + std::map* props) { simgrid::s4u::Host* res = new simgrid::s4u::Host(name); @@ -64,8 +64,8 @@ simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector& link_list, bool symmetrical) +void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, + std::vector& link_list, bool symmetrical) { /* Argument validity checks */ if (gw_dst) { @@ -203,8 +203,8 @@ static void find_common_ancestors(NetPoint* src, NetPoint* dst, } /* PRECONDITION: this is the common ancestor of src and dst */ -bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, - /* OUT */ std::vector& links, double* latency) +bool NetZoneImpl::get_bypass_route(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 (bypass_routes_.empty()) @@ -297,22 +297,22 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, "calls to getRoute", src->get_cname(), dst->get_cname(), bypassedRoute->links.size()); if (src != key.first) - getGlobalRoute(src, bypassedRoute->gw_src, links, latency); + get_global_route(src, bypassedRoute->gw_src, links, latency); for (surf::LinkImpl* const& link : bypassedRoute->links) { links.push_back(link); if (latency) *latency += link->latency(); } if (dst != key.second) - getGlobalRoute(bypassedRoute->gw_dst, dst, links, latency); + get_global_route(bypassedRoute->gw_dst, dst, links, latency); return true; } XBT_DEBUG("No bypass route from '%s' to '%s'.", src->get_cname(), dst->get_cname()); return false; } -void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, - /* OUT */ std::vector& links, double* latency) +void NetZoneImpl::get_global_route(routing::NetPoint* src, routing::NetPoint* dst, + /* OUT */ std::vector& links, double* latency) { RouteCreationArgs route; @@ -327,7 +327,7 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, 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)) + if (common_ancestor->get_bypass_route(src, dst, links, latency)) return; /* If src and dst are in the same netzone, life is good */ @@ -346,13 +346,13 @@ void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst, /* If source gateway is not our source, we have to recursively find our way up to this point */ if (src != route.gw_src) - getGlobalRoute(src, route.gw_src, links, latency); + get_global_route(src, route.gw_src, links, latency); for (auto const& link : route.link_list) links.push_back(link); /* If dest gateway is not our destination, we have to recursively find our way from this point */ if (route.gw_dst != dst) - getGlobalRoute(route.gw_dst, dst, links, latency); + get_global_route(route.gw_dst, dst, links, latency); } } } diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index 7d458d1dfd..fc95e56367 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -63,8 +63,8 @@ RoutedZone::RoutedZone(NetZone* father, std::string name) : NetZoneImpl(father, { } -void RoutedZone::getGraph(xbt_graph_t graph, std::map* nodes, - std::map* edges) +void RoutedZone::get_graph(xbt_graph_t graph, std::map* nodes, + std::map* edges) { std::vector vertices = getVertices(); diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 14d3a0ea59..5342c54ae5 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -163,7 +163,7 @@ void Host::routeTo(Host* dest, std::vector& links, double* latency) /** @brief Just like Host::routeTo, but filling an array of link implementations */ void Host::routeTo(Host* dest, std::vector& links, double* latency) { - simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency); + simgrid::kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint, dest->pimpl_netpoint, links, latency); if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) { XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(), (latency == nullptr ? -1 : *latency)); diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 575e4dd284..a3070cb6db 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -136,7 +136,7 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t std::map* nodes = new std::map; std::map* edges = new std::map; - static_cast(netzone)->getGraph(graph, nodes, edges); + static_cast(netzone)->get_graph(graph, nodes, edges); for (auto elm : *edges) { xbt_edge_t edge = elm.second; linkContainers(simgrid::instr::Container::byName(static_cast(edge->src->data)), @@ -358,7 +358,7 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map(netzone)->getGraph(graph, nodes, edges); + static_cast(netzone)->get_graph(graph, nodes, edges); } xbt_graph_t instr_routing_platform_graph () diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index f507c65872..9d299b9938 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -74,7 +74,7 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args) } simgrid::s4u::Host* host = - routing_get_current()->createHost(args->id, &args->speed_per_pstate, args->core_amount, &props); + routing_get_current()->create_host(args->id, &args->speed_per_pstate, args->core_amount, &props); host->pimpl_->storage_ = mount_list; mount_list.clear(); @@ -404,8 +404,8 @@ void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route) void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreationArgs* bypassRoute) { - routing_get_current()->addBypassRoute(bypassRoute->src, bypassRoute->dst, bypassRoute->gw_src, bypassRoute->gw_dst, - bypassRoute->link_list, bypassRoute->symmetrical); + routing_get_current()->add_bypass_route(bypassRoute->src, bypassRoute->dst, bypassRoute->gw_src, bypassRoute->gw_dst, + bypassRoute->link_list, bypassRoute->symmetrical); } void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) @@ -482,7 +482,7 @@ void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer) std::vector speedPerPstate; speedPerPstate.push_back(peer->speed); - simgrid::s4u::Host* host = as->createHost(peer->id.c_str(), &speedPerPstate, 1, nullptr); + simgrid::s4u::Host* host = as->create_host(peer->id.c_str(), &speedPerPstate, 1, nullptr); as->setPeerLink(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord); diff --git a/teshsuite/simdag/flatifier/flatifier.cpp b/teshsuite/simdag/flatifier/flatifier.cpp index 96ca08adc7..a43c039394 100644 --- a/teshsuite/simdag/flatifier/flatifier.cpp +++ b/teshsuite/simdag/flatifier/flatifier.cpp @@ -129,7 +129,7 @@ static void dump_routes() simgrid::s4u::Host* host2 = hosts[it_dst]; std::vector route; simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint; - simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr); + simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr); if (not route.empty()) { std::printf(" \n ", host1->get_cname(), host2->get_cname()); for (auto const& link : route) @@ -142,7 +142,7 @@ static void dump_routes() if (netcardDst->is_router()) { std::printf(" \n ", host1->get_cname(), netcardDst->get_cname()); std::vector route; - simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr); + simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr); for (auto const& link : route) std::printf("", link->get_cname()); std::printf("\n \n"); @@ -156,7 +156,7 @@ static void dump_routes() if (value2->is_router()) { std::printf(" \n ", value1->get_cname(), value2->get_cname()); std::vector route; - simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr); + simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, value2, route, nullptr); for (auto const& link : route) std::printf("", link->get_cname()); std::printf("\n \n"); @@ -167,7 +167,7 @@ static void dump_routes() std::printf(" \n ", value1->get_cname(), host2->get_cname()); std::vector route; simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint; - simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, netcardDst, route, nullptr); + simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, netcardDst, route, nullptr); for (auto const& link : route) std::printf("", link->get_cname()); std::printf("\n \n");