Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further progress towards deprecation of complex add_route
[simgrid.git] / examples / cpp / plugin-prodcons / s4u-plugin-prodcons.cpp
index f023e78..8d1ceeb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-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. */
@@ -65,12 +65,9 @@ int main(int argc, char* argv[])
     std::string linkname = "cluster_link_" + std::to_string(i);
     const auto* link     = cluster->create_split_duplex_link(linkname, "1Gbps");
 
-    cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, {{link, sg4::LinkInRoute::Direction::UP}},
-                       true);
+    cluster->add_route(host, nullptr,  {{link, sg4::LinkInRoute::Direction::UP}}, true);
   }
-
-  auto* router = cluster->create_router("cluster_router");
-  cluster->add_route(router, nullptr, nullptr, nullptr, {});
+  cluster->seal();
 
   simgrid::plugin::ProducerConsumerPtr<int> pc = simgrid::plugin::ProducerConsumer<int>::create(2);