Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / teshsuite / s4u / cloud-two-execs / cloud-two-execs.cpp
index 96bb428..9f9196d 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-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. */
 
 #include "simgrid/s4u.hpp"
 
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this msg example");
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this example");
 
 simgrid::s4u::ExecPtr exec;
 
@@ -20,7 +20,7 @@ static void computation_fun()
   exec->wait();
   XBT_INFO("%s:%s Exec 1 complete %g", host_name, pr_name, simgrid::s4u::Engine::get_clock() - clock_sta);
 
-  exec = NULL;
+  exec = nullptr;
 
   simgrid::s4u::this_actor::sleep_for(1);
 
@@ -34,7 +34,7 @@ static void computation_fun()
 static void master_main()
 {
   auto* pm0 = simgrid::s4u::Host::by_name("Fafard");
-  auto* vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
+  auto* vm0 = pm0->create_vm("VM0", 1);
   vm0->start();
 
   simgrid::s4u::Actor::create("compute", vm0, computation_fun);
@@ -55,10 +55,10 @@ int main(int argc, char* argv[])
 
   e.load_platform(argv[1]);
 
-  simgrid::s4u::Actor::create("master_", simgrid::s4u::Host::by_name("Fafard"), master_main);
+  simgrid::s4u::Actor::create("master_", e.host_by_name("Fafard"), master_main);
 
   e.run();
-  XBT_INFO("Bye (simulation time %g)", e.get_clock());
+  XBT_INFO("Bye (simulation time %g)", simgrid::s4u::Engine::get_clock());
 
   return 0;
 }