Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Deprecate Comm::wait_all(). Remove it in python
[simgrid.git] / teshsuite / models / issue105 / issue105.cpp
index 37b62c6..c9df586 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-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. */
@@ -15,13 +15,13 @@ namespace sg4 = simgrid::s4u;
 XBT_LOG_NEW_DEFAULT_CATEGORY(issue105, "Issue105");
 static void load_generator(sg4::Mailbox* mailbox)
 {
-  std::vector<sg4::CommPtr> comms;
+  sg4::ActivitySet comms;
 
   // Send the task messages
   for (int i = 0; i < 100; i++) {
     auto* payload     = new int(i);
     sg4::CommPtr comm = mailbox->put_async(payload, 1024);
-    comms.push_back(comm);
+    comms.push(comm);
     sg4::this_actor::sleep_for(1.0);
   }
 
@@ -29,10 +29,10 @@ static void load_generator(sg4::Mailbox* mailbox)
   auto* payload     = new int(-1);
   sg4::CommPtr comm = mailbox->put_async(payload, 1024);
   XBT_INFO("Sent shutdown");
-  comms.push_back(comm);
+  comms.push(comm);
 
   // Wait for all messages to be consumed before ending the simulation
-  sg4::Comm::wait_all(comms);
+  comms.wait_all();
   XBT_INFO("Load generator finished");
 }
 
@@ -75,8 +75,7 @@ int main(int argc, char* argv[])
                                 ->set_bandwidth_profile(linkSaBandwidthProfile)
                                 ->seal();
 
-  world->add_route(hostGl01->get_netpoint(), hostSa01->get_netpoint(), nullptr, nullptr,
-                   {{linkSa, sg4::LinkInRoute::Direction::NONE}}, true);
+  world->add_route(hostGl01, hostSa01, {{linkSa, sg4::LinkInRoute::Direction::NONE}}, true);
   world->seal();
 
   sg4::Mailbox* mb1 = e.mailbox_by_name_or_create("Mailbox 1");