Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Obsolete declaration.
[simgrid.git] / src / surf / sg_platf.cpp
index cdb4e0f..e493ca1 100644 (file)
@@ -274,12 +274,9 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
   // Add a router.
   XBT_DEBUG(" ");
   XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id.c_str());
-  if (cluster->router_id.empty()) {
-    std::string newid   = std::string(cluster->prefix) + cluster->id + "_router" + cluster->suffix;
-    current_as->router_ = sg_platf_new_router(newid, NULL);
-  } else {
-    current_as->router_ = sg_platf_new_router(cluster->router_id, NULL);
-  }
+  if (cluster->router_id.empty())
+    cluster->router_id = std::string(cluster->prefix) + cluster->id + "_router" + cluster->suffix;
+  current_as->router_ = sg_platf_new_router(cluster->router_id, NULL);
 
   //Make the backbone
   if ((cluster->bb_bw > 0) || (cluster->bb_lat > 0)) {
@@ -673,7 +670,7 @@ void sg_platf_new_Zone_seal()
 /** @brief Add a link connecting a host to the rest of its AS (which must be cluster or vivaldi) */
 void sg_platf_new_hostlink(const simgrid::kernel::routing::HostLinkCreationArgs* hostlink)
 {
-  simgrid::kernel::routing::NetPoint* netpoint = simgrid::s4u::Host::by_name(hostlink->id)->get_netpoint();
+  const simgrid::kernel::routing::NetPoint* netpoint = simgrid::s4u::Host::by_name(hostlink->id)->get_netpoint();
   xbt_assert(netpoint, "Host '%s' not found!", hostlink->id.c_str());
   xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
              "Only hosts from Cluster and Vivaldi ASes can get a host_link.");