Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Give a way to add binaries to the list that shouldn't be messed with by sthread
[simgrid.git] / examples / cpp / trace-process-migration / s4u-trace-process-migration.cpp
index 5b0895794d4b469ddfa8d7aa36d768e59c63c881..a09afe82e69170f55fd92a203df4a92a6a3429c5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-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. */
@@ -17,7 +17,7 @@ namespace sg4 = simgrid::s4u;
 /* The guy we will move from host to host. It move alone and then is moved by policeman back  */
 static void emigrant()
 {
-  auto mailbox = sg4::Mailbox::by_name("master_mailbox");
+  auto* mailbox = sg4::Mailbox::by_name("master_mailbox");
 
   sg4::this_actor::sleep_for(2);
 
@@ -35,7 +35,7 @@ static void policeman()
   // I am the master of emigrant actor,
   // I tell it where it must emigrate to.
   auto destinations = {"Tremblay", "Jupiter", "Fafard", "Ginette", "Bourassa", "Fafard", "Tremblay", "Ginette", ""};
-  auto mailbox      = sg4::Mailbox::by_name("master_mailbox");
+  auto* mailbox     = sg4::Mailbox::by_name("master_mailbox");
 
   for (auto const& destination : destinations) {
     mailbox->put_init(new std::string(destination), 0)->set_tracing_category("migration_order")->wait();
@@ -49,10 +49,10 @@ int main(int argc, char* argv[])
 
   e.load_platform(argv[1]);
 
-  TRACE_category("migration_order");
+  simgrid::instr::declare_tracing_category("migration_order");
 
-  sg4::Actor::create("emigrant", sg4::Host::by_name("Fafard"), emigrant);
-  sg4::Actor::create("policeman", sg4::Host::by_name("Tremblay"), policeman);
+  sg4::Actor::create("emigrant", e.host_by_name("Fafard"), emigrant);
+  sg4::Actor::create("policeman", e.host_by_name("Tremblay"), policeman);
 
   e.run();
   return 0;