Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further progress towards deprecation of complex add_route
[simgrid.git] / teshsuite / s4u / io-stream / io-stream.cpp
index 7734156ab278b8266a9e7b9f49b320044dce7f71..6977fbc1391d096b095e5ae21b84934bcc2c2f22 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -12,9 +12,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(io_stream, "Messages specific for this simulation")
 static void streamer(size_t size)
 {
   auto* bob        = sg4::Host::by_name("bob");
-  auto* bob_disk   = bob->get_disks().front();
   auto* alice      = sg4::Host::by_name("alice");
-  auto* alice_disk = alice->get_disks().front();
+  const auto* bob_disk   = bob->get_disks().front();
+  const auto* alice_disk = alice->get_disks().front();
   double clock = sg4::Engine::get_clock();
 
   XBT_INFO("[Bob -> Alice] Store and Forward (1 block)");
@@ -106,8 +106,8 @@ int main(int argc, char** argv)
   auto* bob  = zone->create_host("bob", 1e6);
   auto* alice  = zone->create_host("alice", 1e6);
 
-  sg4::LinkInRoute link(zone->create_link("link", "2MBps")->set_latency("50us")->seal());
-  zone->add_route(bob->get_netpoint(), alice->get_netpoint(), nullptr, nullptr, {link}, true);
+  auto* link = zone->create_link("link", "2MBps")->set_latency("50us");
+  zone->add_route(bob, alice, {link});
 
   bob->create_disk("bob_disk", "1MBps", "500kBps");
   alice->create_disk("alice_disk", "4MBps", "4MBps");