From f3a267e5ba376a0f0313767a12d518ffdeaa7196 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 3 Apr 2018 09:22:39 +0200 Subject: [PATCH] snake_case routing --- include/simgrid/kernel/routing/ClusterZone.hpp | 10 +++++----- .../simgrid/kernel/routing/DijkstraZone.hpp | 6 +++--- .../simgrid/kernel/routing/DragonflyZone.hpp | 2 +- include/simgrid/kernel/routing/EmptyZone.hpp | 2 +- include/simgrid/kernel/routing/FatTreeZone.hpp | 4 ++-- include/simgrid/kernel/routing/FloydZone.hpp | 8 ++++---- include/simgrid/kernel/routing/FullZone.hpp | 8 ++++---- include/simgrid/kernel/routing/NetZoneImpl.hpp | 2 +- include/simgrid/kernel/routing/TorusZone.hpp | 2 +- include/simgrid/kernel/routing/VivaldiZone.hpp | 2 +- include/simgrid/s4u/NetZone.hpp | 18 +++++++++++++++--- src/kernel/routing/ClusterZone.cpp | 12 ++++++------ src/kernel/routing/DijkstraZone.cpp | 8 ++++---- src/kernel/routing/DragonflyZone.cpp | 8 ++++---- src/kernel/routing/FatTreeZone.cpp | 8 ++++---- src/kernel/routing/FloydZone.cpp | 8 ++++---- src/kernel/routing/FullZone.cpp | 8 ++++---- src/kernel/routing/NetZoneImpl.cpp | 4 ++-- src/kernel/routing/RoutedZone.cpp | 2 +- src/kernel/routing/TorusZone.cpp | 2 +- src/kernel/routing/VivaldiZone.cpp | 2 +- src/s4u/s4u_netzone.cpp | 5 +++-- src/surf/sg_platf.cpp | 10 +++++----- 23 files changed, 77 insertions(+), 64 deletions(-) diff --git a/include/simgrid/kernel/routing/ClusterZone.hpp b/include/simgrid/kernel/routing/ClusterZone.hpp index 3ac701161a..0005d46756 100644 --- a/include/simgrid/kernel/routing/ClusterZone.hpp +++ b/include/simgrid/kernel/routing/ClusterZone.hpp @@ -69,7 +69,7 @@ class ClusterZone : public NetZoneImpl { public: explicit ClusterZone(NetZone* father, std::string name); - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; void get_graph(xbt_graph_t graph, std::map* nodes, std::map* edges) override; @@ -83,12 +83,12 @@ public: /* The pair is {linkUp, linkDown} */ std::unordered_map> private_links_; - unsigned int nodePosition(int id) { return id * num_links_per_node_; } - unsigned int nodePositionWithLoopback(int id) { return nodePosition(id) + (has_loopback_ ? 1 : 0); } - unsigned int nodePositionWithLimiter(int id) { return nodePositionWithLoopback(id) + (has_limiter_ ? 1 : 0); } + unsigned int node_pos(int id) { return id * num_links_per_node_; } + unsigned int node_pos_with_loopback(int id) { return node_pos(id) + (has_loopback_ ? 1 : 0); } + unsigned int node_pos_with_loopback_limiter(int id) { return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0); } - surf::LinkImpl* backbone_ = nullptr; void* loopback_ = nullptr; + surf::LinkImpl* backbone_ = nullptr; NetPoint* router_ = nullptr; bool has_limiter_ = false; bool has_loopback_ = false; diff --git a/include/simgrid/kernel/routing/DijkstraZone.hpp b/include/simgrid/kernel/routing/DijkstraZone.hpp index 2a638bd9b0..2003a9a70d 100644 --- a/include/simgrid/kernel/routing/DijkstraZone.hpp +++ b/include/simgrid/kernel/routing/DijkstraZone.hpp @@ -51,9 +51,9 @@ public: * After this function returns, any node in the graph * will have a loopback attached to it. */ - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override; - void addRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, - std::vector& link_list, bool symmetrical) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override; + void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst, + std::vector& link_list, bool symmetrical) override; xbt_graph_t route_graph_ = nullptr; /* xbt_graph */ std::map graph_node_map_; /* map */ diff --git a/include/simgrid/kernel/routing/DragonflyZone.hpp b/include/simgrid/kernel/routing/DragonflyZone.hpp index f5063d97e5..4bccc4ecab 100644 --- a/include/simgrid/kernel/routing/DragonflyZone.hpp +++ b/include/simgrid/kernel/routing/DragonflyZone.hpp @@ -63,7 +63,7 @@ public: explicit DragonflyZone(NetZone* father, std::string name); ~DragonflyZone() override; // void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override; - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; void parse_specific_arguments(ClusterCreationArgs* cluster) override; void seal() override; void generateRouters(); diff --git a/include/simgrid/kernel/routing/EmptyZone.hpp b/include/simgrid/kernel/routing/EmptyZone.hpp index d92f0c09e3..421e552772 100644 --- a/include/simgrid/kernel/routing/EmptyZone.hpp +++ b/include/simgrid/kernel/routing/EmptyZone.hpp @@ -24,7 +24,7 @@ public: explicit EmptyZone(NetZone* father, std::string name); ~EmptyZone() override; - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override { /* There can't be route in an Empty zone */ } diff --git a/include/simgrid/kernel/routing/FatTreeZone.hpp b/include/simgrid/kernel/routing/FatTreeZone.hpp index 251cb3d177..1fb72300dc 100644 --- a/include/simgrid/kernel/routing/FatTreeZone.hpp +++ b/include/simgrid/kernel/routing/FatTreeZone.hpp @@ -100,7 +100,7 @@ class XBT_PRIVATE FatTreeZone : public ClusterZone { public: explicit FatTreeZone(NetZone* father, std::string name); ~FatTreeZone() override; - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; /** \brief Generate the fat tree * @@ -131,7 +131,7 @@ private: ClusterCreationArgs* cluster_ = nullptr; - void addLink(FatTreeNode* parent, unsigned int parent_port, FatTreeNode* child, unsigned int child_port); + void add_link(FatTreeNode* parent, unsigned int parent_port, FatTreeNode* child, unsigned int child_port); int getLevelPosition(const unsigned int level); void generateLabels(); void generateSwitches(); diff --git a/include/simgrid/kernel/routing/FloydZone.hpp b/include/simgrid/kernel/routing/FloydZone.hpp index 7046ec9b89..e9e65ec459 100644 --- a/include/simgrid/kernel/routing/FloydZone.hpp +++ b/include/simgrid/kernel/routing/FloydZone.hpp @@ -26,10 +26,10 @@ public: explicit FloydZone(NetZone* father, std::string name); ~FloydZone() override; - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; - 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) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void add_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) override; void seal() override; private: diff --git a/include/simgrid/kernel/routing/FullZone.hpp b/include/simgrid/kernel/routing/FullZone.hpp index 4890a24df9..5f8fcde90b 100644 --- a/include/simgrid/kernel/routing/FullZone.hpp +++ b/include/simgrid/kernel/routing/FullZone.hpp @@ -24,10 +24,10 @@ public: void seal() override; ~FullZone() override; - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; - 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) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void add_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) override; private: RouteCreationArgs** routing_table_ = nullptr; diff --git a/include/simgrid/kernel/routing/NetZoneImpl.hpp b/include/simgrid/kernel/routing/NetZoneImpl.hpp index 854b1f0181..18a525bfa9 100644 --- a/include/simgrid/kernel/routing/NetZoneImpl.hpp +++ b/include/simgrid/kernel/routing/NetZoneImpl.hpp @@ -70,7 +70,7 @@ protected: * @param into Container into which the traversed links and gateway informations should be pushed * @param latency Accumulator in which the latencies should be added (caller must set it to 0) */ - virtual void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) = 0; + virtual void get_local_route(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 get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst, diff --git a/include/simgrid/kernel/routing/TorusZone.hpp b/include/simgrid/kernel/routing/TorusZone.hpp index 463f654b52..22a172e655 100644 --- a/include/simgrid/kernel/routing/TorusZone.hpp +++ b/include/simgrid/kernel/routing/TorusZone.hpp @@ -23,7 +23,7 @@ class XBT_PRIVATE TorusZone : public ClusterZone { public: explicit TorusZone(NetZone* father, std::string name); void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) override; - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; void parse_specific_arguments(ClusterCreationArgs* cluster) override; private: diff --git a/include/simgrid/kernel/routing/VivaldiZone.hpp b/include/simgrid/kernel/routing/VivaldiZone.hpp index ccec34916a..a5e1bc6599 100644 --- a/include/simgrid/kernel/routing/VivaldiZone.hpp +++ b/include/simgrid/kernel/routing/VivaldiZone.hpp @@ -49,7 +49,7 @@ public: explicit VivaldiZone(NetZone* father, std::string name); void setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, std::string coord); - void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; + void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override; }; namespace vivaldi { diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index defe0cab0c..2b6b42edd0 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -46,6 +46,18 @@ public: XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_name()") const std::string& getName() const { return get_name(); } XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::get_cname()") const char* getCname() const { return get_cname(); } + XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_route()") 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) + { + add_route(src, dst, gw_src, gw_dst, link_list, symmetrical); + } + XBT_ATTRIB_DEPRECATED_v323("Please use NetZone::add_bypass_route()") 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) + { + add_bypass_route(src, dst, gw_src, gw_dst, link_list, symmetrical); + } std::vector* getChildren(); // Sub netzones void getHosts(std::vector * whereto); // retrieve my content as a vector of hosts @@ -60,9 +72,9 @@ public: /* Add content to the netzone, at parsing time. It should be sealed afterward. */ virtual int addComponent(kernel::routing::NetPoint * elm); /* A host, a router or a netzone, whatever */ - 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 add_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); 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; diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index 5b2f74c471..f162c5bf56 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -21,7 +21,7 @@ ClusterZone::ClusterZone(NetZone* father, std::string name) : NetZoneImpl(father { } -void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) +void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) { XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); xbt_assert(not private_links_.empty(), @@ -30,7 +30,7 @@ void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* if ((src->id() == dst->id()) && has_loopback_) { xbt_assert(not src->is_router(), "Routing from a cluster private router to itself is meaningless"); - std::pair info = private_links_.at(nodePosition(src->id())); + std::pair info = private_links_.at(node_pos(src->id())); route->link_list.push_back(info.first); if (lat) *lat += info.first->latency(); @@ -39,11 +39,11 @@ void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* if (not src->is_router()) { // No private link for the private router if (has_limiter_) { // limiter for sender - std::pair info = private_links_.at(nodePositionWithLoopback(src->id())); + std::pair info = private_links_.at(node_pos_with_loopback(src->id())); route->link_list.push_back(info.first); } - std::pair info = private_links_.at(nodePositionWithLimiter(src->id())); + std::pair info = private_links_.at(node_pos_with_loopback_limiter(src->id())); if (info.first) { // link up route->link_list.push_back(info.first); if (lat) @@ -59,14 +59,14 @@ void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* if (not dst->is_router()) { // No specific link for router - std::pair info = private_links_.at(nodePositionWithLimiter(dst->id())); + std::pair info = private_links_.at(node_pos_with_loopback_limiter(dst->id())); if (info.second) { // link down route->link_list.push_back(info.second); if (lat) *lat += info.second->latency(); } if (has_limiter_) { // limiter for receiver - info = private_links_.at(nodePositionWithLoopback(dst->id())); + info = private_links_.at(node_pos_with_loopback(dst->id())); route->link_list.push_back(info.first); } } diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 71715cd179..b26b405e2c 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -123,7 +123,7 @@ void DijkstraZone::newRoute(int src_id, int dst_id, simgrid::kernel::routing::Ro xbt_graph_new_edge(route_graph_, src, dst, e_route); } -void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) +void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) { getRouteCheckParams(src, dst); int src_id = src->id(); @@ -269,9 +269,9 @@ DijkstraZone::DijkstraZone(NetZone* father, std::string name, bool cached) : Rou { } -void DijkstraZone::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) +void DijkstraZone::add_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) { const char* srcName = src->get_cname(); const char* dstName = dst->get_cname(); diff --git a/src/kernel/routing/DragonflyZone.cpp b/src/kernel/routing/DragonflyZone.cpp index d7bc1a1fca..5d31232eb2 100644 --- a/src/kernel/routing/DragonflyZone.cpp +++ b/src/kernel/routing/DragonflyZone.cpp @@ -262,7 +262,7 @@ void DragonflyZone::generateLinks() } } -void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency) +void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency) { // Minimal routing version. // TODO : non-minimal random one, and adaptive ? @@ -274,7 +274,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArg dst->id()); if ((src->id() == dst->id()) && has_loopback_) { - std::pair info = private_links_.at(nodePosition(src->id())); + std::pair info = private_links_.at(node_pos(src->id())); route->link_list.push_back(info.first); if (latency) @@ -302,7 +302,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArg *latency += myRouter->my_nodes_[myCoords[3] * num_links_per_link_]->latency(); if (has_limiter_) { // limiter for sender - std::pair info = private_links_.at(nodePositionWithLoopback(src->id())); + std::pair info = private_links_.at(node_pos_with_loopback(src->id())); route->link_list.push_back(info.first); } @@ -352,7 +352,7 @@ void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArg } if (has_limiter_) { // limiter for receiver - std::pair info = private_links_.at(nodePositionWithLoopback(dst->id())); + std::pair info = private_links_.at(node_pos_with_loopback(dst->id())); route->link_list.push_back(info.first); } diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 66a4fa1097..08849428c2 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -58,7 +58,7 @@ 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->is_router() || src->is_router()) @@ -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); diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 2e9732e88f..c6ace477f3 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -44,7 +44,7 @@ FloydZone::~FloydZone() delete[] cost_table_; } -void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) +void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) { unsigned int table_size = getTableSize(); @@ -85,9 +85,9 @@ void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* r } } -void FloydZone::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) +void FloydZone::add_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) { /* set the size of table routing */ unsigned int table_size = getTableSize(); diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index c2ca632556..f5c8ab5431 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -52,7 +52,7 @@ FullZone::~FullZone() } } -void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* res, double* lat) +void FullZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* res, double* lat) { XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); @@ -70,9 +70,9 @@ void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* re } } -void FullZone::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) +void FullZone::add_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) { addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical); diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index bbff2db92f..1caed8f593 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -333,14 +333,14 @@ void NetZoneImpl::get_global_route(routing::NetPoint* src, routing::NetPoint* ds /* If src and dst are in the same netzone, life is good */ if (src_ancestor == dst_ancestor) { /* SURF_ROUTING_BASE */ route.link_list = std::move(links); - common_ancestor->getLocalRoute(src, dst, &route, latency); + common_ancestor->get_local_route(src, dst, &route, latency); links = std::move(route.link_list); return; } /* Not in the same netzone, no bypass. We'll have to find our path between the netzones recursively */ - common_ancestor->getLocalRoute(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency); + common_ancestor->get_local_route(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->get_cname(), dst->get_cname()); diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index fc95e56367..d61f453c45 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -75,7 +75,7 @@ void RoutedZone::get_graph(xbt_graph_t graph, std::map* RouteCreationArgs* route = new RouteCreationArgs(); - getLocalRoute(my_src, my_dst, route, nullptr); + get_local_route(my_src, my_dst, route, nullptr); XBT_DEBUG("get_route_and_latency %s -> %s", my_src->get_cname(), my_dst->get_cname()); diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index d25a3bac29..e2041cd665 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -93,7 +93,7 @@ void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster) } } -void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) +void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) { XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); diff --git a/src/kernel/routing/VivaldiZone.cpp b/src/kernel/routing/VivaldiZone.cpp index 2d6cb441ab..39666c092b 100644 --- a/src/kernel/routing/VivaldiZone.cpp +++ b/src/kernel/routing/VivaldiZone.cpp @@ -76,7 +76,7 @@ void VivaldiZone::setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, s private_links_.insert({netpoint->id(), {linkUp, linkDown}}); } -void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) +void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) { XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id()); diff --git a/src/s4u/s4u_netzone.cpp b/src/s4u/s4u_netzone.cpp index 8cede7fd59..f15347bdfe 100644 --- a/src/s4u/s4u_netzone.cpp +++ b/src/s4u/s4u_netzone.cpp @@ -104,8 +104,9 @@ int NetZone::addComponent(kernel::routing::NetPoint* elm) return vertices_.size() - 1; // The rank of the newly created object } -void NetZone::addRoute(sg_netpoint_t /*src*/, sg_netpoint_t /*dst*/, sg_netpoint_t /*gw_src*/, sg_netpoint_t /*gw_dst*/, - std::vector& /*link_list*/, bool /*symmetrical*/) +void NetZone::add_route(sg_netpoint_t /*src*/, sg_netpoint_t /*dst*/, sg_netpoint_t /*gw_src*/, + sg_netpoint_t /*gw_dst*/, std::vector& /*link_list*/, + bool /*symmetrical*/) { xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str()); } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 9d299b9938..10f6747be9 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -227,7 +227,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster linkDown = simgrid::surf::LinkImpl::byName(tmp_link); auto* as_cluster = static_cast(current_as); - as_cluster->private_links_.insert({as_cluster->nodePosition(rankId), {linkUp, linkDown}}); + as_cluster->private_links_.insert({as_cluster->node_pos(rankId), {linkUp, linkDown}}); } //add a limiter link (shared link to account for maximal bandwidth of the node) @@ -245,14 +245,14 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster sg_platf_new_link(&link); linkDown = simgrid::surf::LinkImpl::byName(tmp_link); linkUp = linkDown; - current_as->private_links_.insert({current_as->nodePositionWithLoopback(rankId), {linkUp, linkDown}}); + current_as->private_links_.insert({current_as->node_pos_with_loopback(rankId), {linkUp, linkDown}}); } //call the cluster function that adds the others links if (cluster->topology == simgrid::kernel::routing::ClusterTopology::FAT_TREE) { static_cast(current_as)->add_processing_node(i); } else { - current_as->create_links_for_node(cluster, i, rankId, current_as->nodePositionWithLimiter(rankId)); + current_as->create_links_for_node(cluster, i, rankId, current_as->node_pos_with_loopback_limiter(rankId)); } rankId++; } @@ -398,8 +398,8 @@ void sg_platf_new_mount(simgrid::kernel::routing::MountCreationArgs* mount) void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route) { - routing_get_current()->addRoute(route->src, route->dst, route->gw_src, route->gw_dst, route->link_list, - route->symmetrical); + routing_get_current()->add_route(route->src, route->dst, route->gw_src, route->gw_dst, route->link_list, + route->symmetrical); } void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreationArgs* bypassRoute) -- 2.20.1