Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further snake_case in routing
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 2 Apr 2018 21:16:46 +0000 (23:16 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 2 Apr 2018 21:16:46 +0000 (23:16 +0200)
16 files changed:
include/simgrid/kernel/routing/ClusterZone.hpp
include/simgrid/kernel/routing/EmptyZone.hpp
include/simgrid/kernel/routing/NetZoneImpl.hpp
include/simgrid/kernel/routing/RoutedZone.hpp
include/simgrid/s4u/NetZone.hpp
src/instr/instr_interface.cpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/RoutedZone.cpp
src/s4u/s4u_host.cpp
src/surf/instr_routing.cpp
src/surf/sg_platf.cpp
teshsuite/simdag/flatifier/flatifier.cpp

index f44aba3..3ac7011 100644 (file)
@@ -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<std::string, xbt_node_t>* nodes,
-                std::map<std::string, xbt_edge_t>* edges) override;
+  void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                 std::map<std::string, xbt_edge_t>* edges) override;
 
   virtual void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position);
   virtual void parse_specific_arguments(ClusterCreationArgs* cluster)
index cb64ff5..d92f0c0 100644 (file)
@@ -29,8 +29,8 @@ public:
     /* There can't be route in an Empty zone */
   }
 
-  void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* /*nodes*/,
-                std::map<std::string, xbt_edge_t>* /*edges*/) override;
+  void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* /*nodes*/,
+                 std::map<std::string, xbt_edge_t>* /*edges*/) override;
 };
 } // namespace routing
 } // namespace kernel
index dbcde25..854b1f0 100644 (file)
@@ -55,11 +55,11 @@ protected:
 
 public:
   /** @brief Make an host within that NetZone */
-  simgrid::s4u::Host* createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
-                                 std::map<std::string, std::string>* props);
+  simgrid::s4u::Host* create_host(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
+                                  std::map<std::string, std::string>* props);
   /** @brief Creates a new route in this NetZone */
-  void addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                      std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) override;
+  void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                        std::vector<simgrid::surf::LinkImpl*>& 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<surf::LinkImpl*>& links, double* latency);
+  bool get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
+                        /* OUT */ std::vector<surf::LinkImpl*>& 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<surf::LinkImpl*>& links, double* latency);
+  static void get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
+                               /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
 
-  virtual void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
-                        std::map<std::string, xbt_edge_t>* edges) = 0;
+  virtual void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                         std::map<std::string, xbt_edge_t>* edges) = 0;
   enum class RoutingMode {
     unset = 0, /**< Undefined type                                   */
     base,      /**< Base case: use simple link lists for routing     */
index efe3729..81d7c43 100644 (file)
@@ -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<std::string, xbt_node_t>* nodes,
-                std::map<std::string, xbt_edge_t>* edges) override;
+  void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                 std::map<std::string, xbt_edge_t>* edges) override;
   virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
                                               NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
                                               bool symmetrical, bool change_order);
index da36a03..defe0ca 100644 (file)
@@ -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<simgrid::surf::LinkImpl*> & 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<simgrid::surf::LinkImpl*> & 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<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) = 0;
 
   /*** Called on each newly created regular route (not on bypass routes) */
   static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
index 96d7760..7e67512 100644 (file)
@@ -306,7 +306,7 @@ static void instr_user_srcdst_variable(double time, const char *src, const char
     xbt_die("Element '%s' not found!",dst);
 
   std::vector<simgrid::surf::LinkImpl*> 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);
 }
index f8bfb2e..5b2f74c 100644 (file)
@@ -72,8 +72,8 @@ void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs*
   }
 }
 
-void ClusterZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
-                           std::map<std::string, xbt_edge_t>* edges)
+void ClusterZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                            std::map<std::string, xbt_edge_t>* edges)
 {
   xbt_assert(router_,
              "Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");
index 42a622c..71715cd 100644 (file)
@@ -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);
index 8615cfd..78a1c67 100644 (file)
@@ -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<std::string, xbt_node_t>* /*nodes*/,
-                         std::map<std::string, xbt_edge_t>* /*edges*/)
+void EmptyZone::get_graph(xbt_graph_t /*graph*/, std::map<std::string, xbt_node_t>* /*nodes*/,
+                          std::map<std::string, xbt_edge_t>* /*edges*/)
 {
   XBT_ERROR("No routing no graph");
 }
index 63214ee..2e9732e 100644 (file)
@@ -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) {
index 35c07ef..bbff2db 100644 (file)
@@ -43,8 +43,8 @@ NetZoneImpl::~NetZoneImpl()
   simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_);
 }
 
-simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
-                                            std::map<std::string, std::string>* props)
+simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
+                                             std::map<std::string, std::string>* props)
 {
   simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
 
@@ -64,8 +64,8 @@ simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double
   return res;
 }
 
-void NetZoneImpl::addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
-                                 std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+                                   std::vector<simgrid::surf::LinkImpl*>& 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<surf::LinkImpl*>& links, double* latency)
+bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
+                                   /* OUT */ std::vector<surf::LinkImpl*>& 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<surf::LinkImpl*>& links, double* latency)
+void NetZoneImpl::get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
+                                   /* OUT */ std::vector<surf::LinkImpl*>& 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);
 }
 }
 }
index 7d458d1..fc95e56 100644 (file)
@@ -63,8 +63,8 @@ RoutedZone::RoutedZone(NetZone* father, std::string name) : NetZoneImpl(father,
 {
 }
 
-void RoutedZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
-                          std::map<std::string, xbt_edge_t>* edges)
+void RoutedZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+                           std::map<std::string, xbt_edge_t>* edges)
 {
   std::vector<kernel::routing::NetPoint*> vertices = getVertices();
 
index 14d3a0e..5342c54 100644 (file)
@@ -163,7 +163,7 @@ void Host::routeTo(Host* dest, std::vector<Link*>& links, double* latency)
 /** @brief Just like Host::routeTo, but filling an array of link implementations */
 void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>& 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));
index 575e4dd..a3070cb 100644 (file)
@@ -136,7 +136,7 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t
   std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
   std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
 
-  static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
+  static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->get_graph(graph, nodes, edges);
   for (auto elm : *edges) {
     xbt_edge_t edge = elm.second;
     linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
@@ -358,7 +358,7 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map<std::string,
     }
   }
 
-  static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
+  static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->get_graph(graph, nodes, edges);
 }
 
 xbt_graph_t instr_routing_platform_graph ()
index f507c65..9d299b9 100644 (file)
@@ -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<double> 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);
 
index 96ca08a..a43c039 100644 (file)
@@ -129,7 +129,7 @@ static void dump_routes()
       simgrid::s4u::Host* host2 = hosts[it_dst];
       std::vector<simgrid::surf::LinkImpl*> 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("  <route src=\"%s\" dst=\"%s\">\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("  <route src=\"%s\" dst=\"%s\">\n  ", host1->get_cname(), netcardDst->get_cname());
         std::vector<simgrid::surf::LinkImpl*> 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_ctn id=\"%s\"/>", link->get_cname());
         std::printf("\n  </route>\n");
@@ -156,7 +156,7 @@ static void dump_routes()
         if (value2->is_router()) {
           std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), value2->get_cname());
           std::vector<simgrid::surf::LinkImpl*> 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_ctn id=\"%s\"/>", link->get_cname());
           std::printf("\n  </route>\n");
@@ -167,7 +167,7 @@ static void dump_routes()
         std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", value1->get_cname(), host2->get_cname());
         std::vector<simgrid::surf::LinkImpl*> 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_ctn id=\"%s\"/>", link->get_cname());
         std::printf("\n  </route>\n");