Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
empty RoutingPlatf: move the loopback link to the network_model(s)
[simgrid.git] / src / surf / surf_routing.cpp
index 43f6744..7f18490 100644 (file)
@@ -34,9 +34,6 @@ namespace routing {
  * @ingroup SURF_build_api
  * @brief A library containing all known hosts
  */
-xbt_dict_t host_list = nullptr;
-
-int COORD_HOST_LEVEL = -1;         //Coordinates level
 
 int MSG_FILE_LEVEL = -1;             //Msg file level
 
@@ -99,7 +96,7 @@ namespace routing {
  */
 void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, std::vector<Link*> * route, double *latency)
 {
-  XBT_DEBUG("getRouteAndLatency from %s to %s", src->name(), dst->name());
+  XBT_DEBUG("getRouteAndLatency from %s to %s", src->name().c_str(), dst->name().c_str());
 
   AsImpl::getRouteRecursive(src, dst, route, latency);
 }
@@ -132,9 +129,9 @@ xbt_dynar_t RoutingPlatf::getOneLinkRoutes(){
 }}}
 
 /** @brief create the root AS */
-void routing_model_create(Link *loopback)
+void routing_model_create()
 {
-  routing_platf = new simgrid::kernel::routing::RoutingPlatf(loopback);
+  routing_platf = new simgrid::kernel::routing::RoutingPlatf();
 }
 
 /* ************************************************************************** */
@@ -145,13 +142,13 @@ static void check_disk_attachment()
   xbt_lib_cursor_t cursor;
   char *key;
   void **data;
-  simgrid::kernel::routing::NetCard *host_elm;
   xbt_lib_foreach(storage_lib, cursor, key, data) {
-    if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) {
-    simgrid::surf::Storage *storage = static_cast<simgrid::surf::Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
-    host_elm = sg_netcard_by_name_or_null(storage->p_attach);
-    if(!host_elm)
-      surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
+    if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) {
+      simgrid::surf::Storage* storage =
+          static_cast<simgrid::surf::Storage*>(xbt_lib_get_or_null(storage_lib, key, SURF_STORAGE_LEVEL));
+      simgrid::kernel::routing::NetCard* host_elm = sg_netcard_by_name_or_null(storage->attach_);
+      if (!host_elm)
+        surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->attach_);
     }
   }
 }
@@ -168,10 +165,7 @@ void routing_exit() {
   delete routing_platf;
 }
 
-simgrid::kernel::routing::RoutingPlatf::RoutingPlatf(simgrid::surf::Link *loopback)
-: loopback_(loopback)
-{
-}
+simgrid::kernel::routing::RoutingPlatf::RoutingPlatf() = default;
 simgrid::kernel::routing::RoutingPlatf::~RoutingPlatf()
 {
   delete root_;