Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to fix a failure about mutex freed too early in RMA
[simgrid.git] / examples / cpp / exec-ptask-multicore / s4u-exec-ptask-multicore.cpp
index dd3fcbfad43d1abb854036785d74775f3693639f..e7a17cb90f37de90e81429b21dc004172ebdcacc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2017-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. */
@@ -6,12 +6,11 @@
 #include <simgrid/s4u.hpp>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_ptask_multicore, "Messages specific for this s4u example");
-
 namespace sg4 = simgrid::s4u;
 
 static void runner()
 {
-  auto e = sg4::Engine::get_instance();
+  const auto* e = sg4::Engine::get_instance();
   std::vector<double> comp(2, 1e9);
   std::vector<double> comm(4, 0.0);
   // Different hosts.
@@ -61,8 +60,8 @@ static void runner()
   XBT_INFO("Computed 2-core activity on two different hosts. Took %g s", e->get_clock() - start_time);
 
   // Add a background task and change ptask on the fly
-  auto MyHost1                          = e->host_by_name("MyHost1");
-  simgrid::s4u::ExecPtr background_task = MyHost1->exec_async(5e9);
+  auto* MyHost1                         = e->host_by_name("MyHost1");
+  sg4::ExecPtr background_task          = MyHost1->exec_async(5e9);
   XBT_INFO("Start a 1-core background task on the 4-core host.");
 
   start_time = sg4::Engine::get_clock();