Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further progress towards deprecation of complex add_route
[simgrid.git] / teshsuite / s4u / seal-platform / seal-platform.cpp
index 3b7d79a..d32d2d9 100644 (file)
@@ -6,7 +6,7 @@
 #include "simgrid/s4u.hpp"
 namespace sg4 = simgrid::s4u;
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_torus_multicpu, "Messages specific for this s4u example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(seal_platform, "Messages specific for this s4u example");
 
 class Sender {
   long msg_size = 1e6; /* message size in bytes */
@@ -58,17 +58,16 @@ public:
 /*************************************************************************************************/
 static sg4::NetZone* create_zone(const sg4::NetZone* root, const std::string& id)
 {
-  auto* zone = sg4::create_floyd_zone(id);
-  zone->set_parent(root);
+  auto* zone = sg4::create_star_zone(id)->set_parent(root);
   constexpr int n_host = 2;
 
-  auto* router = zone->create_router("router" + id);
+  zone->set_gateway(zone->create_router("router" + id));
   for (int i = 0; i < n_host; i++) {
     std::string hostname = id + "-cpu-" + std::to_string(i);
     auto* host           = zone->create_host(hostname, 1e9);
     host->create_disk("disk-" + hostname, 1e9, 1e6);
     const auto* link = zone->create_link("link-" + hostname, 1e9);
-    zone->add_route(host->get_netpoint(), router, nullptr, nullptr, {link});
+    zone->add_route(host, nullptr, {link});
   }
   return zone;
 }
@@ -84,8 +83,7 @@ int main(int argc, char* argv[])
   auto* zoneA = create_zone(root, "A");
   auto* zoneB = create_zone(root, "B");
   const auto* link = root->create_link("root-link", 1e10);
-  root->add_route(zoneA->get_netpoint(), zoneB->get_netpoint(), e.netpoint_by_name("routerA"),
-                  e.netpoint_by_name("routerB"), {sg4::LinkInRoute(link)});
+  root->add_route(zoneA, zoneB, {sg4::LinkInRoute(link)}, true);
 
   std::vector<sg4::Host*> host_list = e.get_all_hosts();
   /* create the sender actor running on first host */