Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / examples / cpp / energy-link / s4u-energy-link.cpp
index c5a7558..d347a3f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-2022. 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. */
@@ -35,7 +35,7 @@ static void sender(std::vector<std::string> args)
     std::vector<simgrid::s4u::CommPtr> comms;
     for (int i = 0; i < flow_amount; i++)
       comms.push_back(mailbox->put_async(bprintf("%d", i), comm_size));
-    simgrid::s4u::Comm::wait_all(&comms);
+    simgrid::s4u::Comm::wait_all(comms);
   }
   XBT_INFO("sender done.");
 }
@@ -59,7 +59,7 @@ static void receiver(std::vector<std::string> args)
     for (int i = 0; i < flow_amount; i++)
       comms.push_back(mailbox->get_async<char>(&data[i]));
 
-    simgrid::s4u::Comm::wait_all(&comms);
+    simgrid::s4u::Comm::wait_all(comms);
     for (int i = 0; i < flow_amount; i++)
       xbt_free(data[i]);
   }
@@ -99,8 +99,8 @@ int main(int argc, char* argv[])
   } else { // No parameter at all? Then use the default value
     argSender.emplace_back("25000");
   }
-  simgrid::s4u::Actor::create("sender", simgrid::s4u::Host::by_name("MyHost1"), sender, argSender);
-  simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name("MyHost2"), receiver, argReceiver);
+  simgrid::s4u::Actor::create("sender", e.host_by_name("MyHost1"), sender, argSender);
+  simgrid::s4u::Actor::create("receiver", e.host_by_name("MyHost2"), receiver, argReceiver);
 
   /* And now, launch the simulation */
   e.run();