Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'split_link_impl' into 'master'
[simgrid.git] / examples / platforms / routing_cluster.cpp
index 364d76e..0f150b1 100644 (file)
@@ -16,8 +16,8 @@ namespace sg4 = simgrid::s4u;
  * @param host List of hostname inside the cluster
  * @param single_link_host Hostname of "special" node
  */
-static void create_cluster(sg4::NetZone* root, const std::string& cluster_suffix, const std::vector<std::string>& hosts,
-                           const std::string& single_link_host)
+static void create_cluster(const sg4::NetZone* root, const std::string& cluster_suffix,
+                           const std::vector<std::string>& hosts, const std::string& single_link_host)
 {
   auto* cluster = sg4::create_star_zone("cluster" + cluster_suffix);
   cluster->set_parent(root);
@@ -29,7 +29,7 @@ static void create_cluster(sg4::NetZone* root, const std::string& cluster_suffix
   /* create all hosts and connect them to outside world */
   for (const auto& hostname : hosts) {
     /* create host */
-    sg4::Host* host = cluster->create_host(hostname, std::vector<double>{1e9});
+    const sg4::Host* host = cluster->create_host(hostname, std::vector<double>{1e9});
     /* create UP link */
     sg4::Link* l_up = cluster->create_link(hostname + "_up", std::vector<double>{1.25e8})->set_latency(0.0001)->seal();
     /* create DOWN link, if needed */
@@ -39,9 +39,11 @@ static void create_cluster(sg4::NetZone* root, const std::string& cluster_suffix
     }
 
     /* add link UP and backbone for communications from the host */
-    cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, std::vector<sg4::Link*>{l_up, l_bb}, false);
+    cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, std::vector<sg4::LinkInRoute>{l_up, l_bb},
+                       false);
     /* add backbone and link DOWN for communications to the host */
-    cluster->add_route(nullptr, host->get_netpoint(), nullptr, nullptr, std::vector<sg4::Link*>{l_bb, l_down}, false);
+    cluster->add_route(nullptr, host->get_netpoint(), nullptr, nullptr, std::vector<sg4::LinkInRoute>{l_bb, l_down},
+                       false);
   }
 
   /* create router */