Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clang-tidy: readability-qualified-auto.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 6 Jun 2023 10:02:17 +0000 (12:02 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 6 Jun 2023 10:02:17 +0000 (12:02 +0200)
Also add const qualifiers to pointers and references when possible.

91 files changed:
docs/source/tuto_mc/ndet-receive-s4u.cpp
docs/source/tuto_network_calibration/dahu_platform_ckmeans.cpp
examples/cpp/battery-degradation/s4u-battery-degradation.cpp
examples/cpp/battery-energy/s4u-battery-energy.cpp
examples/cpp/battery-simple/s4u-battery-simple.cpp
examples/cpp/clusters-multicpu/s4u-clusters-multicpu.cpp
examples/cpp/comm-failure/s4u-comm-failure.cpp
examples/cpp/dag-comm/s4u-dag-comm.cpp
examples/cpp/dag-from-dax-simple/s4u-dag-from-dax-simple.cpp
examples/cpp/dag-from-dax/s4u-dag-from-dax.cpp
examples/cpp/dag-from-dot-simple/s4u-dag-from-dot-simple.cpp
examples/cpp/dag-from-dot/s4u-dag-from-dot.cpp
examples/cpp/dag-io/s4u-dag-io.cpp
examples/cpp/dag-scheduling/s4u-dag-scheduling.cpp
examples/cpp/dag-simple/s4u-dag-simple.cpp
examples/cpp/exec-failure/s4u-exec-failure.cpp
examples/cpp/exec-ptask-multicore-latency/s4u-exec-ptask-multicore-latency.cpp
examples/cpp/exec-ptask-multicore/s4u-exec-ptask-multicore.cpp
examples/cpp/exec-threads/s4u-exec-threads.cpp
examples/cpp/network-factors/s4u-network-factors.cpp
examples/cpp/network-wifi/s4u-network-wifi.cpp
examples/cpp/photovoltaic-simple/s4u-photovoltaic-simple.cpp
examples/cpp/plugin-link-load/s4u-plugin-link-load.cpp
examples/cpp/synchro-condition-variable-waituntil/s4u-synchro-condition-variable-waituntil.cpp
examples/cpp/task-io/s4u-task-io.cpp
examples/cpp/task-simple/s4u-task-simple.cpp
examples/cpp/task-variable-load/s4u-task-variable-load.cpp
examples/cpp/trace-categories/s4u-trace-categories.cpp
examples/cpp/trace-masterworkers/s4u-trace-masterworkers.cpp
examples/cpp/trace-process-migration/s4u-trace-process-migration.cpp
examples/platforms/supernode.cpp
examples/smpi/replay/replay.cpp
src/instr/instr_platform.cpp
src/kernel/EngineImpl.cpp
src/kernel/activity/SemaphoreImpl.cpp
src/kernel/actor/ActorImpl.cpp
src/kernel/actor/CommObserver.cpp
src/kernel/actor/Simcall.cpp
src/kernel/resource/HostImpl.cpp
src/kernel/resource/VirtualMachineImpl.cpp
src/kernel/resource/models/host_clm03.cpp
src/kernel/resource/models/network_cm02.cpp
src/kernel/resource/models/ptask_L07.cpp
src/kernel/resource/profile/Profile_test.cpp
src/kernel/xml/platf_sax_cb.cpp
src/mc/api/State.cpp
src/mc/explo/CommunicationDeterminismChecker.cpp
src/mc/explo/DFSExplorer.cpp
src/mc/explo/UdporChecker.cpp
src/mc/explo/odpor/ReversibleRaceCalculator.cpp
src/mc/explo/odpor/WakeupTree.cpp
src/mc/explo/odpor/WakeupTree.hpp
src/mc/explo/udpor/Configuration_test.cpp
src/mc/explo/udpor/EventSet_test.cpp
src/mc/explo/udpor/ExtensionSetCalculator.cpp
src/mc/explo/udpor/Unfolding.cpp
src/mc/explo/udpor/Unfolding_test.cpp
src/mc/explo/udpor/maximal_subsets_iterator.cpp
src/mc/remote/CheckerSide.cpp
src/mc/transition/TransitionComm.cpp
src/mc/transition/TransitionSynchro.cpp
src/plugins/chaos_monkey.cpp
src/plugins/host_energy.cpp
src/plugins/host_load.cpp
src/plugins/link_energy.cpp
src/plugins/link_energy_wifi.cpp
src/plugins/link_load.cpp
src/plugins/vm/dirty_page_tracking.cpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_Engine.cpp
src/s4u/s4u_Netzone.cpp
src/smpi/bindings/smpi_pmpi.cpp
src/smpi/internals/instr_smpi.cpp
src/smpi/internals/smpi_memory.cpp
src/smpi/internals/smpi_replay.cpp
src/smpi/mpi/smpi_request.cpp
src/smpi/smpi_replay_main.cpp
src/xbt/config_test.cpp
src/xbt/exception.cpp
src/xbt/parmap.hpp
src/xbt/utils/iter/subsets_tests.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/mc/mutex-handling/mutex-handling.cpp
teshsuite/s4u/activity-lifecycle/testing_comm_direct.cpp
teshsuite/s4u/actor-suspend/actor-suspend.cpp
teshsuite/s4u/dag-incomplete-simulation/dag-incomplete-simulation.cpp
teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp
teshsuite/s4u/issue71/issue71.cpp
teshsuite/s4u/seal-platform/seal-platform.cpp
teshsuite/s4u/wait-all-for/wait-all-for.cpp
teshsuite/s4u/wait-any-for/wait-any-for.cpp

index 061ae71..cf1aba3 100644 (file)
@@ -17,7 +17,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example");
 
 static void server()
 {
-  auto mb = sg4::Mailbox::by_name("mymailbox");
+  auto* mb      = sg4::Mailbox::by_name("mymailbox");
   int value_got = -1;
   for (int count = 0; count < N; count++) {
     int *received = mb->get<int>();
index 4ee3584..162233c 100644 (file)
@@ -118,7 +118,7 @@ void load_platform(const sg4::Engine& e)
   static std::mt19937 gen(42); // remove it from stack, since we need it after this this load_platform function is over
 
   /* setting network factors callbacks */
-  auto zone = e.get_netzone_root();
+  auto* zone = e.get_netzone_root();
 
   SegmentedRegression seg = read_json_file("pingpong_ckmeans.json", gen, false);
   zone->set_latency_factor_cb(std::bind(&latency_factor_cb, lat_base, seg, std::placeholders::_1, std::placeholders::_2,
index 0aad5a1..3a56ff0 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(battery_degradation, "Messages specific for this s4
 
 static void manager()
 {
-  auto battery = simgrid::s4u::this_actor::get_host();
+  const auto* battery = simgrid::s4u::this_actor::get_host();
   double power = 100;
   while (sg_battery_get_state_of_health(battery) > 0) {
     XBT_INFO("%f,%f,SoC", simgrid::s4u::Engine::get_clock(), sg_battery_get_state_of_charge(battery));
index 55bfc3c..558cbc2 100644 (file)
@@ -13,9 +13,9 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(battery_energy, "Messages specific for this s4u exa
 
 static void manager()
 {
-  auto battery = simgrid::s4u::Engine::get_instance()->host_by_name("battery");
-  auto host1   = simgrid::s4u::Engine::get_instance()->host_by_name("host1");
-  auto host2   = simgrid::s4u::Engine::get_instance()->host_by_name("host2");
+  const auto* battery = simgrid::s4u::Engine::get_instance()->host_by_name("battery");
+  auto* host1         = simgrid::s4u::Engine::get_instance()->host_by_name("host1");
+  auto* host2         = simgrid::s4u::Engine::get_instance()->host_by_name("host2");
 
   XBT_INFO("Initial Battery: SoC: %f SoH: %f Capacity (Total): %fWh Capacity (Usable): %fWh P: %fW",
            sg_battery_get_state_of_charge(battery), sg_battery_get_state_of_health(battery),
index 435c402..03e9a57 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(battery_simple, "Messages specific for this s4u exa
 
 static void manager()
 {
-  auto battery         = simgrid::s4u::Engine::get_instance()->host_by_name("battery");
+  const auto* battery  = simgrid::s4u::Engine::get_instance()->host_by_name("battery");
   double consumption_w = 200;
 
   XBT_INFO("Initial Battery: SoC: %f SoH: %f Capacity (Total): %fWh Capacity (Usable): %fWh P: %f",
index f0c2b7e..b637a23 100644 (file)
@@ -37,7 +37,7 @@ public:
       auto* payload = new std::string(msg_content);
 
       /* Create a communication representing the ongoing communication, and store it in pending_comms */
-      auto mbox = sg4::Mailbox::by_name(host->get_name());
+      auto* mbox = sg4::Mailbox::by_name(host->get_name());
       mboxes.push_back(mbox);
       sg4::CommPtr comm = mbox->put_async(payload, msg_size);
       pending_comms.push_back(comm);
@@ -57,7 +57,7 @@ class Receiver {
 public:
   void operator()() const
   {
-    auto mbox     = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
+    auto* mbox    = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
     auto received = mbox->get_unique<std::string>();
     XBT_INFO("I got a '%s'.", received->c_str());
   }
index c278fac..90b3778 100644 (file)
@@ -24,8 +24,8 @@ public:
 
   void operator()() const
   {
-    auto mailbox1 = sg4::Mailbox::by_name(mailbox1_name);
-    auto mailbox2 = sg4::Mailbox::by_name(mailbox2_name);
+    auto* mailbox1 = sg4::Mailbox::by_name(mailbox1_name);
+    auto* mailbox2 = sg4::Mailbox::by_name(mailbox2_name);
 
     XBT_INFO("Initiating asynchronous send to %s", mailbox1->get_cname());
     auto comm1 = mailbox1->put_async((void*)666, 5);
index 184e416..77cb31d 100644 (file)
@@ -15,8 +15,8 @@ int main(int argc, char* argv[])
   sg4::Engine e(&argc, argv);
   e.load_platform(argv[1]);
 
-  auto tremblay = e.host_by_name("Tremblay");
-  auto jupiter  = e.host_by_name("Jupiter");
+  auto* tremblay = e.host_by_name("Tremblay");
+  auto* jupiter  = e.host_by_name("Jupiter");
 
   // Display the details on vetoed activities
   sg4::Exec::on_veto_cb([](sg4::Exec const& exec) {
index 950cd77..aa8e17d 100644 (file)
@@ -26,8 +26,8 @@ int main(int argc, char* argv[])
 
   for (const auto& a : dag) {
     if (auto* comm = dynamic_cast<simgrid::s4u::Comm*>(a.get())) {
-      auto pred = dynamic_cast<simgrid::s4u::Exec*>((*comm->get_dependencies().begin()).get());
-      auto succ = dynamic_cast<simgrid::s4u::Exec*>(comm->get_successors().front().get());
+      const auto* pred = dynamic_cast<simgrid::s4u::Exec*>((*comm->get_dependencies().begin()).get());
+      const auto* succ = dynamic_cast<simgrid::s4u::Exec*>(comm->get_successors().front().get());
       comm->set_source(pred->get_host())->set_destination(succ->get_host());
     }
   }
index 3bae907..9c62ac8 100644 (file)
@@ -51,8 +51,8 @@ int main(int argc, char** argv)
       cursor++;
     }
     if (auto* comm = dynamic_cast<sg4::Comm*>(a.get())) {
-      auto pred = dynamic_cast<sg4::Exec*>((*comm->get_dependencies().begin()).get());
-      auto succ = dynamic_cast<sg4::Exec*>(comm->get_successors().front().get());
+      const auto* pred = dynamic_cast<sg4::Exec*>((*comm->get_dependencies().begin()).get());
+      const auto* succ = dynamic_cast<sg4::Exec*>(comm->get_successors().front().get());
       comm->set_source(pred->get_host())->set_destination(succ->get_host());
     }
   }
index a5532eb..a6972b0 100644 (file)
@@ -26,8 +26,8 @@ int main(int argc, char* argv[])
 
   for (const auto& a : dag) {
     if (auto* comm = dynamic_cast<simgrid::s4u::Comm*>(a.get())) {
-      auto pred = dynamic_cast<simgrid::s4u::Exec*>((*comm->get_dependencies().begin()).get());
-      auto succ = dynamic_cast<simgrid::s4u::Exec*>(comm->get_successors().front().get());
+      const auto* pred = dynamic_cast<simgrid::s4u::Exec*>((*comm->get_dependencies().begin()).get());
+      const auto* succ = dynamic_cast<simgrid::s4u::Exec*>(comm->get_successors().front().get());
       comm->set_source(pred->get_host())->set_destination(succ->get_host());
     }
   }
index 079e323..30d2b75 100644 (file)
@@ -49,8 +49,8 @@ int main(int argc, char** argv)
       cursor++;
     }
     if (auto* comm = dynamic_cast<sg4::Comm*>(a.get())) {
-      auto pred = dynamic_cast<sg4::Exec*>((*comm->get_dependencies().begin()).get());
-      auto succ = dynamic_cast<sg4::Exec*>(comm->get_successors().front().get());
+      const auto* pred = dynamic_cast<sg4::Exec*>((*comm->get_dependencies().begin()).get());
+      const auto* succ = dynamic_cast<sg4::Exec*>(comm->get_successors().front().get());
       comm->set_source(pred->get_host())->set_destination(succ->get_host());
     }
   }
index 0ca2de2..738f356 100644 (file)
@@ -15,8 +15,8 @@ int main(int argc, char* argv[])
   sg4::Engine e(&argc, argv);
   e.load_platform(argv[1]);
 
-  auto bob  = e.host_by_name("bob");
-  auto carl = e.host_by_name("carl");
+  auto* bob  = e.host_by_name("bob");
+  auto* carl = e.host_by_name("carl");
 
   // Display the details on vetoed activities
   sg4::Exec::on_veto_cb([](sg4::Exec const& exec) {
index 7b76aa9..51dde09 100644 (file)
@@ -17,7 +17,7 @@ static std::vector<sg4::Exec*> get_ready_tasks(const std::vector<sg4::ActivityPt
   std::vector<sg4::Exec*> ready_tasks;
   std::map<sg4::Exec*, unsigned int> candidate_execs;
 
-  for (auto& a : dax) {
+  for (const auto& a : dax) {
     // Only look at activity that have their dependencies solved but are not assigned
     if (a->dependencies_solved() && not a->is_assigned()) {
       // if it is an exec, it's ready
@@ -49,7 +49,7 @@ static sg4::Host* get_best_host(const sg4::ExecPtr exec, double* min_finish_time
     for (const auto& parent : exec->get_dependencies()) {
       /* normal case */
       if (const auto* comm = dynamic_cast<sg4::Comm*>(parent.get())) {
-        auto source = comm->get_source();
+        const auto* source = comm->get_source();
         XBT_DEBUG("transfer from %s to %s", source->get_cname(), host->get_cname());
         /* Estimate the redistribution time from this parent */
         double redist_time;
@@ -171,7 +171,7 @@ int main(int argc, char** argv)
     sg4::Exec* selected_task = nullptr;
     sg4::Host* selected_host = nullptr;
 
-    for (auto exec : ready_tasks) {
+    for (auto* exec : ready_tasks) {
       XBT_DEBUG("%s is ready", exec->get_cname());
       double finish_time;
       host = get_best_host(exec, &finish_time);
index 78a0158..6f60e2e 100644 (file)
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
   std::set<sg4::Activity*> vetoed;
   e.track_vetoed_activities(&vetoed);
 
-  auto fafard = e.host_by_name("Fafard");
+  auto* fafard = e.host_by_name("Fafard");
 
   // Display the details on vetoed activities
   sg4::Exec::on_veto_cb([](sg4::Exec const& exec) {
index 545b4f5..4a4063b 100644 (file)
@@ -80,7 +80,7 @@ int main(int argc, char** argv)
 
   auto* zone  = sg4::create_full_zone("world");
   std::vector<sg4::Host*> hosts;
-  for (auto name : {"Host1", "Host2", "Host3"}) {
+  for (const auto* name : {"Host1", "Host2", "Host3"}) {
     auto* host = zone->create_host(name, "1f");
     hosts.push_back(host);
   }
index a8926c1..08b01f3 100644 (file)
@@ -11,7 +11,7 @@ namespace sg4 = simgrid::s4u;
 
 static void runner()
 {
-  auto e = sg4::Engine::get_instance();
+  auto* e = sg4::Engine::get_instance();
   std::vector<double> comp(2, 1e9);
   std::vector<double> comm(4, 0.0);
   // Different hosts.
index 75f9701..8cfad72 100644 (file)
@@ -10,7 +10,7 @@ namespace sg4 = simgrid::s4u;
 
 static void runner()
 {
-  auto e = sg4::Engine::get_instance();
+  auto* e = sg4::Engine::get_instance();
   std::vector<double> comp(2, 1e9);
   std::vector<double> comm(4, 0.0);
   // Different hosts.
@@ -60,7 +60,7 @@ 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");
+  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.");
 
index 6230a14..8a16b5e 100644 (file)
@@ -11,7 +11,7 @@ namespace sg4 = simgrid::s4u;
 
 static void runner()
 {
-  auto e                    = sg4::Engine::get_instance();
+  auto* e                   = sg4::Engine::get_instance();
   sg4::Host* multicore_host = e->host_by_name("MyHost1");
   // First test with less than, same number as, and more threads than cores
   double start_time = sg4::Engine::get_clock();
index 9721efa..1ff67f6 100644 (file)
@@ -183,7 +183,7 @@ public:
         }
 
         /* Create a communication representing the ongoing communication */
-        auto mbox     = sg4::Mailbox::by_name(host->get_name());
+        auto* mbox    = sg4::Mailbox::by_name(host->get_name());
         auto* payload = new std::string(msg);
         mbox->put(payload, static_cast<uint64_t>(size));
       }
@@ -192,7 +192,7 @@ public:
     XBT_INFO("Done dispatching all messages");
     /* sending message to stop receivers */
     for (const auto* host : hosts_) {
-      auto mbox = sg4::Mailbox::by_name(host->get_name());
+      auto* mbox = sg4::Mailbox::by_name(host->get_name());
       mbox->put(new std::string("finalize"), 0);
     }
   }
@@ -203,7 +203,7 @@ class Receiver {
 public:
   void operator()() const
   {
-    auto mbox = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
+    auto* mbox = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
     // Receiving the message was all we were supposed to do
     for (bool cont = true; cont;) {
       auto received = mbox->get_unique<std::string>();
index 33f8e9a..13eae66 100644 (file)
@@ -35,14 +35,14 @@ int main(int argc, char* argv[])
   e.load_platform(argv[1]);
 
   /* Exchange a message between the 2 stations */
-  auto mailbox  = sg4::Mailbox::by_name("mailbox");
-  auto station1 = e.host_by_name("Station 1");
-  auto station2 = e.host_by_name("Station 2");
+  auto* mailbox  = sg4::Mailbox::by_name("mailbox");
+  auto* station1 = e.host_by_name("Station 1");
+  auto* station2 = e.host_by_name("Station 2");
   sg4::Actor::create("sender", station1, sender, mailbox, 1e7);
   sg4::Actor::create("receiver", station2, receiver, mailbox);
 
   /* Declare that the stations are not at the same distance from their AP */
-  auto ap = e.link_by_name("AP1");
+  const auto* ap = e.link_by_name("AP1");
   ap->set_host_wifi_rate(station1, 1); // The host "Station 1" uses the second level of bandwidths on that AP
   ap->set_host_wifi_rate(station2, 0); // This is perfectly useless as level 0 is used by default
 
index eb18645..afb65f0 100644 (file)
@@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(photovoltaic_simple, "Messages specific for this s4
 
 static void manager()
 {
-  auto pv_panel = simgrid::s4u::Engine::get_instance()->host_by_name("pv_panel");
+  const auto* pv_panel = simgrid::s4u::Engine::get_instance()->host_by_name("pv_panel");
   std::vector<std::pair<double, double>> solar_irradiance = {{1, 10}, {100, 5}, {200, 20}};
   for (auto [t, s] : solar_irradiance) {
     simgrid::s4u::this_actor::sleep_until(t);
index c76cbe8..5f962a1 100644 (file)
@@ -11,14 +11,14 @@ namespace sg4 = simgrid::s4u;
 
 static void sender(const std::string& mailbox, uint64_t msg_size)
 {
-  auto mbox          = sg4::Mailbox::by_name(mailbox);
+  auto* mbox         = sg4::Mailbox::by_name(mailbox);
   static int payload = 42;
   mbox->put(&payload, msg_size);
 }
 
 static void receiver(const std::string& mailbox)
 {
-  auto mbox = sg4::Mailbox::by_name(mailbox);
+  auto* mbox = sg4::Mailbox::by_name(mailbox);
   mbox->get<int>();
 }
 
@@ -31,8 +31,8 @@ static void run_transfer(sg4::Host* src_host, sg4::Host* dst_host, const std::st
 
 static void execute_load_test()
 {
-  auto host0 = sg4::Host::by_name("node-0.simgrid.org");
-  auto host1 = sg4::Host::by_name("node-1.simgrid.org");
+  auto* host0 = sg4::Host::by_name("node-0.simgrid.org");
+  auto* host1 = sg4::Host::by_name("node-1.simgrid.org");
 
   sg4::this_actor::sleep_for(1);
   run_transfer(host0, host1, "1", 1000 * 1000 * 1000);
@@ -52,9 +52,9 @@ static void show_link_load(const std::string& link_name, const sg4::Link* link)
 
 static void monitor()
 {
-  auto link_backbone = sg4::Link::by_name("cluster0_backbone");
-  auto link_host0    = sg4::Link::by_name("cluster0_link_0_UP");
-  auto link_host1    = sg4::Link::by_name("cluster0_link_1_DOWN");
+  const auto* link_backbone = sg4::Link::by_name("cluster0_backbone");
+  const auto* link_host0    = sg4::Link::by_name("cluster0_link_0_UP");
+  const auto* link_host1    = sg4::Link::by_name("cluster0_link_1_DOWN");
 
   XBT_INFO("Tracking desired links");
   sg_link_load_track(link_backbone);
index 67d1ac2..b660bf3 100644 (file)
@@ -40,7 +40,7 @@ static void main_actor()
   auto cv    = sg4::ConditionVariable::create();
   auto ready = std::make_shared<bool>(false);
 
-  auto host = sg4::this_actor::get_host();
+  auto* host = sg4::this_actor::get_host();
   for (int i = 0; i < 10; ++i)
     sg4::Actor::create("competitor", host, competitor, i, cv, mtx, ready);
   sg4::Actor::create("go", host, go, cv, mtx, ready);
index 4150f44..6301657 100644 (file)
@@ -26,8 +26,8 @@ int main(int argc, char* argv[])
   simgrid::plugins::Task::init();
 
   // Retrieve hosts
-  auto bob  = e.host_by_name("bob");
-  auto carl = e.host_by_name("carl");
+  auto* bob  = e.host_by_name("bob");
+  auto* carl = e.host_by_name("carl");
 
   // Create tasks
   auto exec1 = simgrid::plugins::ExecTask::init("exec1", 1e9, bob);
index 0eddb5a..3e9d14f 100644 (file)
@@ -25,8 +25,8 @@ int main(int argc, char* argv[])
   simgrid::plugins::Task::init();
 
   // Retrieve hosts
-  auto tremblay = e.host_by_name("Tremblay");
-  auto jupiter  = e.host_by_name("Jupiter");
+  auto* tremblay = e.host_by_name("Tremblay");
+  auto* jupiter  = e.host_by_name("Jupiter");
 
   // Create tasks
   auto exec1 = simgrid::plugins::ExecTask::init("exec1", 1e9, tremblay);
index ddcea76..960fb66 100644 (file)
@@ -40,8 +40,8 @@ int main(int argc, char* argv[])
   simgrid::plugins::Task::init();
 
   // Retreive hosts
-  auto tremblay = e.host_by_name("Tremblay");
-  auto jupiter  = e.host_by_name("Jupiter");
+  auto* tremblay = e.host_by_name("Tremblay");
+  auto* jupiter  = e.host_by_name("Jupiter");
 
   // Create tasks
   auto comm = simgrid::plugins::CommTask::init("comm", 1e7, tremblay, jupiter);
index 30a6d30..adf6f3d 100644 (file)
@@ -22,7 +22,7 @@ struct Task {
 
 static void master()
 {
-  auto mbox = sg4::Mailbox::by_name("master_mailbox");
+  auto* mbox = sg4::Mailbox::by_name("master_mailbox");
   for (int i = 0; i < 10; i++) {
     Task task;
     if (i % 2)
@@ -39,7 +39,7 @@ static void master()
 
 static void worker()
 {
-  auto mbox = sg4::Mailbox::by_name("master_mailbox");
+  auto* mbox = sg4::Mailbox::by_name("master_mailbox");
   while (true) {
     auto task = mbox->get_unique<Task>();
     if (task->name == "finalize") {
index 14a4b74..d63d4a1 100644 (file)
@@ -24,7 +24,7 @@ static void master(std::vector<std::string> args)
   long communication_cost = std::stol(args[3]);
   size_t workers_count    = args.size() - 4;
   const auto& my_host     = sg4::this_actor::get_host()->get_name();
-  auto mailbox            = sg4::Mailbox::by_name("master_mailbox");
+  auto* mailbox           = sg4::Mailbox::by_name("master_mailbox");
 
   XBT_DEBUG("Got %zu workers and %ld tasks to process", workers_count, tasks_count);
 
@@ -54,7 +54,7 @@ static void worker(std::vector<std::string> args)
   xbt_assert(args.size() == 1, "The worker expects no argument");
 
   const auto& my_host = sg4::this_actor::get_host()->get_name();
-  auto mailbox        = sg4::Mailbox::by_name("master_mailbox");
+  auto* mailbox       = sg4::Mailbox::by_name("master_mailbox");
 
   simgrid::instr::set_host_variable(my_host, "is_worker", 1);
   simgrid::instr::set_host_variable(my_host, "task_computation", 0);
index cecea13..a09afe8 100644 (file)
@@ -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();
index aa9089e..fa2c42d 100644 (file)
@@ -59,7 +59,7 @@ static sg4::NetZone* create_supernode(const sg4::NetZone* root, const std::strin
     const auto& linkname  = "link_" + node_name;
 
     sg4::NetZone* node = create_node(supernode, node_name, nb_cpu);
-    const auto router  = node->create_router("router_" + node_name);
+    auto* router       = node->create_router("router_" + node_name);
     node->seal();
 
     const sg4::Link* l = supernode->create_split_duplex_link(linkname, BW_NODE)->set_latency(LAT_NODE)->seal();
@@ -83,7 +83,7 @@ static sg4::NetZone* create_cluster(const std::string& cluster_name, const int n
     const auto& linkname       = "link_" + supernode_name;
 
     sg4::NetZone* supernode = create_supernode(cluster, supernode_name, nb_nodes, nb_cpu);
-    const auto router       = supernode->create_router("router_" + supernode_name);
+    auto* router            = supernode->create_router("router_" + supernode_name);
     supernode->seal();
 
     const sg4::Link* l = cluster->create_split_duplex_link(linkname, BW_NETWORK)->set_latency(LAT_NETWORK)->seal();
index d6fff83..216f7f3 100644 (file)
@@ -22,7 +22,7 @@ static void action_blah(const simgrid::xbt::ReplayAction& /*args*/)
 
 int main(int argc, char* argv[])
 {
-  auto properties = simgrid::s4u::Actor::self()->get_properties();
+  const auto* properties = simgrid::s4u::Actor::self()->get_properties();
 
   const char* instance_id = properties->at("instance_id").c_str();
   const int rank          = static_cast<int>(xbt_str_parse_int(properties->at("rank").c_str(), "Cannot parse rank"));
index 94b95e3..1519f80 100644 (file)
@@ -485,8 +485,7 @@ void define_callbacks()
   if (TRACE_actor_is_enabled()) {
     s4u::Actor::on_creation_cb(on_actor_creation);
     s4u::Actor::on_destruction_cb([](s4u::Actor const& actor) {
-      auto container = Container::by_name_or_null(instr_pid(actor));
-      if (container != nullptr)
+      if (auto* container = Container::by_name_or_null(instr_pid(actor)))
         container->remove_from_parent();
     });
     s4u::Actor::on_suspend_cb([](s4u::Actor const& actor) {
index f4a3d74..9fa412e 100644 (file)
@@ -490,7 +490,7 @@ double EngineImpl::solve(double max_date) const
   }
 
   XBT_DEBUG("Looking for next event in all models");
-  for (auto model : models_) {
+  for (auto* model : models_) {
     if (not model->next_occurring_event_is_idempotent())
       continue;
 
@@ -508,7 +508,7 @@ double EngineImpl::solve(double max_date) const
     double next_event_date = profile::future_evt_set.next_date();
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
-    for (auto model : models_) {
+    for (auto* model : models_) {
       /* Skip all idempotent models, they were already treated above
        * NS3 is the one to handled here */
       if (model->next_occurring_event_is_idempotent())
index 8cba364..dc7ccbe 100644 (file)
@@ -68,7 +68,7 @@ void SemAcquisitionImpl::finish()
 void SemAcquisitionImpl::cancel()
 {
   /* Remove myself from the list of interested parties */
-  auto issuer = get_issuer();
+  auto* issuer = get_issuer();
   auto it     = std::find_if(semaphore_->ongoing_acquisitions_.begin(), semaphore_->ongoing_acquisitions_.end(),
                              [issuer](SemAcquisitionImplPtr acqui) { return acqui->get_issuer() == issuer; });
   xbt_assert(it != semaphore_->ongoing_acquisitions_.end(),
index 4f5fb24..013ad5b 100644 (file)
@@ -372,7 +372,7 @@ activity::ActivityImplPtr ActorImpl::sleep(double duration)
     throw_exception(std::make_exception_ptr(
         HostFailureException(XBT_THROW_POINT, "Host " + host_->get_name() + " failed, you cannot sleep there.")));
 
-  auto sleep_activity = new activity::SleepImpl();
+  auto* sleep_activity = new activity::SleepImpl();
   sleep_activity->set_name("sleep").set_host(host_).set_duration(duration).start();
   return activity::SleepImplPtr(sleep_activity);
 }
index c065e2a..d330caf 100644 (file)
@@ -40,7 +40,7 @@ void ActivityTestanySimcall::prepare(int times_considered)
 }
 static void serialize_activity_test(const activity::ActivityImpl* act, std::stringstream& stream)
 {
-  if (auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
+  if (const auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
     stream << "  " << (short)mc::Transition::Type::COMM_TEST;
     stream << ' ' << (uintptr_t)comm;
     stream << ' ' << (comm->src_actor_ != nullptr ? comm->src_actor_->get_pid() : -1);
@@ -53,7 +53,7 @@ static void serialize_activity_test(const activity::ActivityImpl* act, std::stri
 }
 static std::string to_string_activity_test(const activity::ActivityImpl* act)
 {
-  if (auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
+  if (const auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
     const std::string src_buff_id = ptr_to_id<unsigned char>(comm->src_buff_);
     const std::string dst_buff_id = ptr_to_id<unsigned char>(comm->dst_buff_);
     return "CommTest(comm_id:" + ptr_to_id<activity::CommImpl const>(comm) +
@@ -92,7 +92,7 @@ std::string ActivityTestSimcall::to_string() const
 }
 static void serialize_activity_wait(const activity::ActivityImpl* act, bool timeout, std::stringstream& stream)
 {
-  if (auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
+  if (const auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
     stream << (short)mc::Transition::Type::COMM_WAIT << ' ';
     stream << timeout << ' ' << (uintptr_t)comm;
 
@@ -106,7 +106,7 @@ static void serialize_activity_wait(const activity::ActivityImpl* act, bool time
 }
 static std::string to_string_activity_wait(const activity::ActivityImpl* act)
 {
-  if (auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
+  if (const auto* comm = dynamic_cast<activity::CommImpl const*>(act)) {
     const std::string src_buff_id = ptr_to_id<unsigned char>(comm->src_buff_);
     const std::string dst_buff_id = ptr_to_id<unsigned char>(comm->dst_buff_);
     return "CommWait(comm_id:" + ptr_to_id<activity::CommImpl const>(comm) +
index 87605e4..05f232f 100644 (file)
@@ -45,7 +45,7 @@ void ObjectAccessSimcallItem::take_ownership()
 static void simcall(simgrid::kernel::actor::Simcall::Type call, std::function<void()> const& code,
                     simgrid::kernel::actor::SimcallObserver* observer)
 {
-  auto self                = simgrid::kernel::actor::ActorImpl::self();
+  auto* self               = simgrid::kernel::actor::ActorImpl::self();
   self->simcall_.call_     = call;
   self->simcall_.code_     = &code;
   self->simcall_.observer_ = observer;
@@ -74,7 +74,7 @@ void simcall_run_blocking(std::function<void()> const& code, simgrid::kernel::ac
 
 void simcall_run_object_access(std::function<void()> const& code, simgrid::kernel::actor::ObjectAccessSimcallItem* item)
 {
-  auto self = simgrid::kernel::actor::ActorImpl::self();
+  auto* self = simgrid::kernel::actor::ActorImpl::self();
 
   // We only need a simcall if the order of the setters is important (parallel run or MC execution).
   // Otherwise, just call the function with no simcall
index e72375a..614bf9e 100644 (file)
@@ -207,8 +207,8 @@ std::vector<s4u::VirtualMachine*> HostImpl::get_vms() const
 
 s4u::Disk* HostImpl::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
-  auto disk = piface_.get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth,
-                                                                                          write_bandwidth);
+  auto* disk = piface_.get_netpoint()->get_englobing_zone()->get_disk_model()->create_disk(name, read_bandwidth,
+                                                                                           write_bandwidth);
   if (sealed_)
     disk->seal();
   return disk->set_host(&piface_)->get_iface();
index b01f733..e8d813f 100644 (file)
@@ -94,7 +94,7 @@ static void remove_active_exec(s4u::Exec const& exec)
 
 static s4u::VirtualMachine* get_vm_from_activity(s4u::Activity const& act)
 {
-  auto* exec = dynamic_cast<kernel::activity::ExecImpl const*>(act.get_impl());
+  const auto* exec = dynamic_cast<kernel::activity::ExecImpl const*>(act.get_impl());
   return exec != nullptr ? dynamic_cast<s4u::VirtualMachine*>(exec->get_host()) : nullptr;
 }
 
@@ -173,7 +173,7 @@ double VMModel::next_occurring_event(double now)
 
 Action* VMModel::execute_thread(const s4u::Host* host, double flops_amount, int thread_count)
 {
-  auto cpu = host->get_cpu();
+  auto* cpu = host->get_cpu();
   return cpu->execution_start(thread_count * flops_amount, thread_count, -1);
 }
 
index 2c4afc6..c5b47a1 100644 (file)
@@ -53,8 +53,8 @@ static inline double has_cost(const double* array, size_t pos)
 Action* HostCLM03Model::io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk,
                                   double size)
 {
-  auto net_model = src_host->get_englobing_zone()->get_network_model();
-  auto system    = net_model->get_maxmin_system();
+  auto* net_model = src_host->get_englobing_zone()->get_network_model();
+  auto* system    = net_model->get_maxmin_system();
   auto* action   = net_model->communicate(src_host, dst_host, size, -1, true);
 
   // We don't want to apply the network model bandwidth factor to the I/O constraints
@@ -112,7 +112,7 @@ Action* HostCLM03Model::execute_parallel(const std::vector<s4u::Host*>& host_lis
 
 Action* HostCLM03Model::execute_thread(const s4u::Host* host, double flops_amount, int thread_count)
 {
-  auto cpu = host->get_cpu();
+  auto* cpu = host->get_cpu();
   /* Create a single action whose cost is thread_count * flops_amount and that requests thread_count cores. */
   return cpu->execution_start(thread_count * flops_amount, thread_count, -1);
 }
index 36cc2a3..1a3f926 100644 (file)
@@ -149,14 +149,14 @@ NetworkCm02Model::NetworkCm02Model(const std::string& name) : NetworkModel(name)
 StandardLinkImpl* NetworkCm02Model::create_link(const std::string& name, const std::vector<double>& bandwidths)
 {
   xbt_assert(bandwidths.size() == 1, "Non-WIFI links must use only 1 bandwidth.");
-  auto link = new NetworkCm02Link(name, bandwidths[0], get_maxmin_system());
+  auto* link = new NetworkCm02Link(name, bandwidths[0], get_maxmin_system());
   link->set_model(this);
   return link;
 }
 
 StandardLinkImpl* NetworkCm02Model::create_wifi_link(const std::string& name, const std::vector<double>& bandwidths)
 {
-  auto link = new WifiLinkImpl(name, bandwidths, get_maxmin_system());
+  auto* link = new WifiLinkImpl(name, bandwidths, get_maxmin_system());
   link->set_model(this);
   return link;
 }
index eefedf3..d0344f9 100644 (file)
@@ -56,7 +56,7 @@ HostL07Model::HostL07Model(const std::string& name, lmm::System* sys) : HostMode
   set_maxmin_system(sys);
 
   auto net_model = std::make_shared<NetworkL07Model>("Network_Ptask", this, sys);
-  auto engine    = EngineImpl::get_instance();
+  auto* engine   = EngineImpl::get_instance();
   engine->add_model(net_model);
   engine->get_netzone_root()->set_network_model(net_model);
 
@@ -257,7 +257,7 @@ CpuImpl* CpuL07Model::create_cpu(s4u::Host* host, const std::vector<double>& spe
 StandardLinkImpl* NetworkL07Model::create_link(const std::string& name, const std::vector<double>& bandwidths)
 {
   xbt_assert(bandwidths.size() == 1, "Non WIFI link must have only 1 bandwidth.");
-  auto link = new LinkL07(name, bandwidths[0], get_maxmin_system());
+  auto* link = new LinkL07(name, bandwidths[0], get_maxmin_system());
   link->set_model(this);
   return link;
 }
index e32e6ae..97ff0ab 100644 (file)
@@ -44,7 +44,7 @@ static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char
 
   MockedResource daResource;
   simgrid::kernel::profile::FutureEvtSet fes;
-  simgrid::kernel::profile::Event* insertedIt = trace->schedule(&fes, &daResource);
+  const simgrid::kernel::profile::Event* insertedIt = trace->schedule(&fes, &daResource);
 
   while (fes.next_date() <= 20.0 && fes.next_date() >= 0) {
     MockedResource::the_date = fes.next_date();
index 340b47a..d48b491 100644 (file)
@@ -269,7 +269,7 @@ static void add_remote_disks()
       continue;
     std::vector<std::string> tokens;
     boost::split(tokens, remote_disk_str, boost::is_any_of(":"));
-    simgrid::s4u::Host* remote_host = simgrid::s4u::Host::by_name_or_null(tokens[2]);
+    const simgrid::s4u::Host* remote_host = simgrid::s4u::Host::by_name_or_null(tokens[2]);
     xbt_assert(remote_host, "You're trying to access a host that does not exist. Please check your platform file");
 
     const simgrid::s4u::Disk* disk = nullptr;
@@ -1009,9 +1009,9 @@ void simgrid_parse(bool fire_on_platform_created_callback_param)
   for (auto const& [trace, name] : trace_connect_list_host_avail) {
     simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(),
                          "<trace_connect kind=\"HOST_AVAIL\">: Trace " + trace + " undefined.");
-    auto profile = traces_set_list.at(trace);
+    auto* profile = traces_set_list.at(trace);
 
-    auto host = engine->host_by_name_or_null(name);
+    auto* host = engine->host_by_name_or_null(name);
     simgrid_parse_assert(host, "<trace_connect kind=\"HOST_AVAIL\">: Host " + name + " undefined.");
     host->set_state_profile(profile);
   }
@@ -1020,9 +1020,9 @@ void simgrid_parse(bool fire_on_platform_created_callback_param)
   for (auto const& [trace, name] : trace_connect_list_host_speed) {
     simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(),
                          "<trace_connect kind=\"SPEED\">: Trace " + trace + " undefined.");
-    auto profile = traces_set_list.at(trace);
+    auto* profile = traces_set_list.at(trace);
 
-    auto host = engine->host_by_name_or_null(name);
+    auto* host = engine->host_by_name_or_null(name);
     simgrid_parse_assert(host, "<trace_connect kind=\"SPEED\">: Host " + name + " undefined.");
     host->set_speed_profile(profile);
   }
@@ -1031,9 +1031,9 @@ void simgrid_parse(bool fire_on_platform_created_callback_param)
   for (auto const& [trace, name] : trace_connect_list_link_avail) {
     simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(),
                          "<trace_connect kind=\"LINK_AVAIL\">: Trace " + trace + " undefined.");
-    auto profile = traces_set_list.at(trace);
+    auto* profile = traces_set_list.at(trace);
 
-    auto link = engine->link_by_name_or_null(name);
+    auto* link = engine->link_by_name_or_null(name);
     simgrid_parse_assert(link, "<trace_connect kind=\"LINK_AVAIL\">: Link " + name + " undefined.");
     link->set_state_profile(profile);
   }
@@ -1042,9 +1042,9 @@ void simgrid_parse(bool fire_on_platform_created_callback_param)
   for (auto const& [trace, name] : trace_connect_list_link_bw) {
     simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(),
                          "<trace_connect kind=\"BANDWIDTH\">: Trace " + trace + " undefined.");
-    auto profile = traces_set_list.at(trace);
+    auto* profile = traces_set_list.at(trace);
 
-    auto link = engine->link_by_name_or_null(name);
+    auto* link = engine->link_by_name_or_null(name);
     simgrid_parse_assert(link, "<trace_connect kind=\"BANDWIDTH\">: Link " + name + " undefined.");
     link->set_bandwidth_profile(profile);
   }
@@ -1053,9 +1053,9 @@ void simgrid_parse(bool fire_on_platform_created_callback_param)
   for (auto const& [trace, name] : trace_connect_list_link_lat) {
     simgrid_parse_assert(traces_set_list.find(trace) != traces_set_list.end(),
                          "<trace_connect kind=\"LATENCY\">: Trace " + trace + " undefined.");
-    auto profile = traces_set_list.at(trace);
+    auto* profile = traces_set_list.at(trace);
 
-    auto link = engine->link_by_name_or_null(name);
+    auto* link = engine->link_by_name_or_null(name);
     simgrid_parse_assert(link, "<trace_connect kind=\"LATENCY\">: Link " + name + " undefined.");
     link->set_latency_profile(profile);
   }
index b05bf39..877835f 100644 (file)
@@ -62,7 +62,7 @@ State::State(RemoteApp& remote_app, std::shared_ptr<State> parent_state)
     /* For each actor in the previous sleep set, keep it if it is not dependent with current transition.
      * And if we kept it and the actor is enabled in this state, mark the actor as already done, so that
      * it is not explored*/
-    for (auto& [aid, transition] : parent_state_->get_sleep_set()) {
+    for (const auto& [aid, transition] : parent_state_->get_sleep_set()) {
       if (not incoming_transition_->depends(transition.get())) {
         sleep_set_.try_emplace(aid, transition);
         if (strategy_->actors_to_run_.count(aid) != 0) {
index a340c2c..8a70fc7 100644 (file)
@@ -100,7 +100,7 @@ public:
   std::vector<unsigned> communication_indices_;
 
   static simgrid::xbt::Extension<simgrid::mc::State, StateCommDet> EXTENSION_ID;
-  explicit StateCommDet(CommDetExtension& checker, RemoteApp const& remote_app)
+  explicit StateCommDet(CommDetExtension const& checker, RemoteApp const& remote_app)
   {
     const unsigned long maxpid = remote_app.get_maxpid();
     for (unsigned long i = 0; i < maxpid; i++) {
@@ -235,7 +235,7 @@ void CommDetExtension::get_comm_pattern(const Transition* transition)
   pattern->index = initial_pattern.index_comm + incomplete_pattern.size();
 
   if (transition->type_ == Transition::Type::COMM_ASYNC_SEND) {
-    auto* send = static_cast<const CommSendTransition*>(transition);
+    const auto* send = static_cast<const CommSendTransition*>(transition);
 
     pattern->type      = PatternCommunicationType::send;
     pattern->comm_addr = send->get_comm();
@@ -244,7 +244,7 @@ void CommDetExtension::get_comm_pattern(const Transition* transition)
     // FIXME: Detached sends should be enforced when the receive is waited
 
   } else if (transition->type_ == Transition::Type::COMM_ASYNC_RECV) {
-    auto* recv = static_cast<const CommRecvTransition*>(transition);
+    const auto* recv = static_cast<const CommRecvTransition*>(transition);
 
     pattern->type      = PatternCommunicationType::receive;
     pattern->comm_addr = recv->get_comm();
@@ -327,8 +327,8 @@ Exploration* create_communication_determinism_checker(const std::vector<char*>&
 
   XBT_DEBUG("********* Start communication determinism verification *********");
 
-  auto base      = new DFSExplorer(args, mode, true);
-  auto extension = new CommDetExtension(*base);
+  auto* base      = new DFSExplorer(args, mode, true);
+  auto* extension = new CommDetExtension(*base);
 
   DFSExplorer::on_exploration_start([extension](RemoteApp const&) {
     XBT_INFO("Check communication determinism");
index 2c72764..a5f06d5 100644 (file)
@@ -200,7 +200,7 @@ void DFSExplorer::run()
 
     if (_sg_mc_sleep_set && XBT_LOG_ISENABLED(mc_dfs, xbt_log_priority_verbose)) {
       XBT_VERB("Sleep set actually containing:");
-      for (auto& [aid, transition] : state->get_sleep_set())
+      for (const auto& [aid, transition] : state->get_sleep_set())
         XBT_VERB("  <%ld,%s>", aid, transition->to_string().c_str());
     }
 
@@ -399,7 +399,7 @@ std::shared_ptr<State> DFSExplorer::next_odpor_state()
     const auto& state = *iter;
     state->do_odpor_unwind();
     XBT_DEBUG("\tPerformed ODPOR 'clean-up'. Sleep set has:");
-    for (auto& [aid, transition] : state->get_sleep_set())
+    for (const auto& [aid, transition] : state->get_sleep_set())
       XBT_DEBUG("\t  <%ld,%s>", aid, transition->to_string().c_str());
     if (!state->has_empty_tree()) {
       return state;
@@ -455,7 +455,7 @@ void DFSExplorer::backtrack()
         } else {
           XBT_DEBUG("ODPOR: Ignoring race: `sleep(E')` intersects `WI_[E'](v := notdep(%u, E))`", e);
           XBT_DEBUG("Sleep set contains:");
-          for (auto& [aid, transition] : prev_state.get_sleep_set())
+          for (const auto& [aid, transition] : prev_state.get_sleep_set())
             XBT_DEBUG("  <%ld,%s>", aid, transition->to_string().c_str());
         }
       }
index e367890..6bd87a6 100644 (file)
@@ -163,7 +163,7 @@ EventSet UdporChecker::compute_exC(const Configuration& C, const State& stateC,
 EventSet UdporChecker::compute_enC(const Configuration& C, const EventSet& exC) const
 {
   EventSet enC;
-  for (const auto e : exC) {
+  for (const auto* e : exC) {
     if (C.is_compatible_with(e)) {
       enC.insert(e);
     }
index efab9d3..105a0f9 100644 (file)
@@ -41,7 +41,7 @@ bool ReversibleRaceCalculator::is_race_reversible(const Execution& E, Execution:
                  {Action::TESTANY, &ReversibleRaceCalculator::is_race_reversible_TestAny},
                  {Action::WAITANY, &ReversibleRaceCalculator::is_race_reversible_WaitAny}};
 
-  const auto e2_action = E.get_transition_for_handle(e2);
+  const auto* e2_action = E.get_transition_for_handle(e2);
   if (const auto handler = handlers.find(e2_action->type_); handler != handlers.end()) {
     return handler->second(E, e1, e2_action);
   } else {
@@ -196,4 +196,4 @@ bool ReversibleRaceCalculator::is_race_reversible_WaitAny(const Execution&, Exec
   return false;
 }
 
-} // namespace simgrid::mc::odpor
\ No newline at end of file
+} // namespace simgrid::mc::odpor
index 7b73e6c..4489dd5 100644 (file)
@@ -120,7 +120,7 @@ void WakeupTree::remove_subtree_rooted_at(WakeupTreeNode* root)
   std::list<WakeupTreeNode*> subtree_contents{root};
   std::list<WakeupTreeNode*> frontier{root};
   while (not frontier.empty()) {
-    auto node = frontier.front();
+    const auto* node = frontier.front();
     frontier.pop_front();
     for (const auto& child : node->get_ordered_children()) {
       frontier.push_back(child);
@@ -145,7 +145,7 @@ void WakeupTree::remove_min_single_process_subtree()
   }
 }
 
-bool WakeupTree::contains(WakeupTreeNode* node) const
+bool WakeupTree::contains(const WakeupTreeNode* node) const
 {
   return std::find_if(this->nodes_.begin(), this->nodes_.end(), [=](const auto& pair) { return pair.first == node; }) !=
          this->nodes_.end();
@@ -216,4 +216,4 @@ void WakeupTree::insert_sequence_after(WakeupTreeNode* node, const PartialExecut
   }
 }
 
-} // namespace simgrid::mc::odpor
\ No newline at end of file
+} // namespace simgrid::mc::odpor
index 59b96c3..0ffcc67 100644 (file)
@@ -115,7 +115,7 @@ private:
   void insert_node(std::unique_ptr<WakeupTreeNode> node);
   void insert_sequence_after(WakeupTreeNode* node, const PartialExecution& w);
   void remove_node(WakeupTreeNode* node);
-  bool contains(WakeupTreeNode* node) const;
+  bool contains(const WakeupTreeNode* node) const;
 
   /**
    * @brief Removes the node `root` and all of its descendants from
index 4e33378..0d2217f 100644 (file)
@@ -330,7 +330,7 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Topological Sort Order Very Compli
 
     std::for_each(ordered_events.begin(), ordered_events.end(), [&events_seen](const UnfoldingEvent* e) {
       History history(e);
-      for (auto* e_hist : history) {
+      for (const auto* e_hist : history) {
         // In this demo, we want to make sure that
         // we don't mark not yet seeing `e` as an error.
         // The history of `e` traverses `e` itself. All
@@ -358,7 +358,7 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Topological Sort Order Very Compli
     std::for_each(ordered_events.begin(), ordered_events.end(), [&events_seen](const UnfoldingEvent* e) {
       History history(e);
 
-      for (auto* e_hist : history) {
+      for (const auto* e_hist : history) {
         // Unlike the test above, we DO want to ensure
         // that `e` itself ALSO isn't yet seen
 
@@ -814,47 +814,47 @@ TEST_CASE("simgrid::mc::udpor::Configuration: Computing Full Alternatives in Rea
 
   auto e0 = std::make_unique<UnfoldingEvent>(
       EventSet(), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e0_handle = e0.get();
+  auto* e0_handle = e0.get();
 
   auto e1        = std::make_unique<UnfoldingEvent>(EventSet({e0_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e1_handle = e1.get();
+  auto* e1_handle = e1.get();
 
   auto e2 = std::make_unique<UnfoldingEvent>(
       EventSet({e1_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 1));
-  auto e2_handle = e2.get();
+  auto* e2_handle = e2.get();
 
   auto e3 = std::make_unique<UnfoldingEvent>(
       EventSet({e1_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 2));
-  auto e3_handle = e3.get();
+  auto* e3_handle = e3.get();
 
   auto e4 = std::make_unique<UnfoldingEvent>(
       EventSet({e0_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 1));
-  auto e4_handle = e4.get();
+  auto* e4_handle = e4.get();
 
   auto e5        = std::make_unique<UnfoldingEvent>(EventSet({e4_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e5_handle = e5.get();
+  auto* e5_handle = e5.get();
 
   auto e6 = std::make_unique<UnfoldingEvent>(
       EventSet({e5_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 2));
-  auto e6_handle = e6.get();
+  auto* e6_handle = e6.get();
 
   auto e7 = std::make_unique<UnfoldingEvent>(
       EventSet({e0_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 2));
-  auto e7_handle = e7.get();
+  auto* e7_handle = e7.get();
 
   auto e8        = std::make_unique<UnfoldingEvent>(EventSet({e4_handle, e7_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e8_handle = e8.get();
+  auto* e8_handle = e8.get();
 
   auto e9        = std::make_unique<UnfoldingEvent>(EventSet({e7_handle}),
                                              std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 0));
-  auto e9_handle = e9.get();
+  auto* e9_handle = e9.get();
 
   auto e10 = std::make_unique<UnfoldingEvent>(
       EventSet({e9_handle}), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 1));
-  auto e10_handle = e10.get();
+  auto* e10_handle = e10.get();
 
   SECTION("Alternative computation call 1")
   {
index 3fc7349..32512e7 100644 (file)
@@ -1120,7 +1120,7 @@ TEST_CASE("simgrid::mc::udpor::EventSet: Topological Ordering Property Observed
 
       std::for_each(ordered_events.begin(), ordered_events.end(), [&](const UnfoldingEvent* e) {
         History history(e);
-        for (auto* e_hist : history) {
+        for (const auto* e_hist : history) {
           if (e_hist == e)
             continue;
           REQUIRE_FALSE(invalid_events.contains(e_hist));
@@ -1138,7 +1138,7 @@ TEST_CASE("simgrid::mc::udpor::EventSet: Topological Ordering Property Observed
       std::for_each(ordered_events.begin(), ordered_events.end(), [&events_seen](const UnfoldingEvent* e) {
         History history(e);
 
-        for (auto* e_hist : history) {
+        for (const auto* e_hist : history) {
           // Unlike the test above, we DO want to ensure
           // that `e` itself ALSO isn't yet seen
 
index 491ec2d..b50a454 100644 (file)
@@ -57,16 +57,16 @@ EventSet ExtensionSetCalculator::partially_extend_CommSend(const Configuration&
   // NOTE: If `preEvt(a, C)` doesn't exist, we're effectively asking
   // about `config({})`
   if (pre_event_a_C.has_value()) {
-    const auto e_prime = U->discover_event(EventSet({pre_event_a_C.value()}), send_action);
+    const auto* e_prime = U->discover_event(EventSet({pre_event_a_C.value()}), send_action);
     exC.insert(e_prime);
   } else {
-    const auto e_prime = U->discover_event(EventSet(), send_action);
+    const auto* e_prime = U->discover_event(EventSet(), send_action);
     exC.insert(e_prime);
   }
 
   // 2. foreach e âˆˆ C s.t. Î»(e) âˆˆ {AsyncSend(m, _), TestAny(Com)} where
   // Com contains a matching c' = AsyncReceive(m, _) with a
-  for (const auto e : C) {
+  for (const auto* e : C) {
     const bool transition_type_check = [&]() {
       if (const auto* async_send = dynamic_cast<const CommSendTransition*>(e->get_transition());
           async_send != nullptr) {
@@ -81,7 +81,7 @@ EventSet ExtensionSetCalculator::partially_extend_CommSend(const Configuration&
 
       // TODO: Check D_K(a, lambda(e))
       if (true) {
-        const auto e_prime = U->discover_event(std::move(K), send_action);
+        const auto* e_prime = U->discover_event(std::move(K), send_action);
         exC.insert(e_prime);
       }
     }
@@ -104,16 +104,16 @@ EventSet ExtensionSetCalculator::partially_extend_CommRecv(const Configuration&
 
   // 1. Create `e' := <a, config(preEvt(a, C))>` and add `e'` to `ex(C)`
   if (pre_event_a_C.has_value()) {
-    const auto e_prime = U->discover_event(EventSet({pre_event_a_C.value()}), recv_action);
+    const auto* e_prime = U->discover_event(EventSet({pre_event_a_C.value()}), recv_action);
     exC.insert(e_prime);
   } else {
-    const auto e_prime = U->discover_event(EventSet(), recv_action);
+    const auto* e_prime = U->discover_event(EventSet(), recv_action);
     exC.insert(e_prime);
   }
 
   // 2. foreach e âˆˆ C s.t. Î»(e) âˆˆ {AsyncSend(m, _), TestAny(Com)} where
   // Com contains a matching c' = AsyncReceive(m, _) with a
-  for (const auto e : C) {
+  for (const auto* e : C) {
     const bool transition_type_check = [&]() {
       if (const auto* async_recv = dynamic_cast<const CommRecvTransition*>(e->get_transition());
           async_recv != nullptr && async_recv->get_mailbox() == recv_mailbox) {
@@ -128,7 +128,7 @@ EventSet ExtensionSetCalculator::partially_extend_CommRecv(const Configuration&
 
       // TODO: Check D_K(a, lambda(e))
       if (true) {
-        const auto e_prime = U->discover_event(std::move(K), recv_action);
+        const auto* e_prime = U->discover_event(std::move(K), recv_action);
         exC.insert(e_prime);
       }
     }
@@ -181,7 +181,7 @@ EventSet ExtensionSetCalculator::partially_extend_CommWait(const Configuration&
   // First, if `pre_event_a_C == std::nullopt`, then there is nothing to
   // do: `CommWait` will never be enabled in the empty configuration (at
   // least two actions must be executed before)
-  if (pre_event_a_C.has_value(); const auto unwrapped_pre_event = pre_event_a_C.value()) {
+  if (pre_event_a_C.has_value(); const auto* unwrapped_pre_event = pre_event_a_C.value()) {
     // A necessary condition is that the issuer be present in
     // config({preEvt(a, C)}); otherwise, the `CommWait` could not
     // be enabled since the communication on which it waits would not
@@ -262,7 +262,7 @@ EventSet ExtensionSetCalculator::partially_extend_CommWait(const Configuration&
   }
 
   // 3. foreach event e in C do
-  for (const auto e : C) {
+  for (const auto* e : C) {
     if (const CommSendTransition* e_issuer_send = dynamic_cast<const CommSendTransition*>(e_issuer->get_transition());
         e_issuer_send != nullptr) {
       // If the provider of the communication for `CommWait` is a
index 421217e..587d4e9 100644 (file)
@@ -11,7 +11,7 @@ namespace simgrid::mc::udpor {
 
 void Unfolding::mark_finished(const EventSet& events)
 {
-  for (const auto e : events) {
+  for (const auto* e : events) {
     mark_finished(e);
   }
 }
@@ -50,7 +50,7 @@ const UnfoldingEvent* Unfolding::insert(std::unique_ptr<UnfoldingEvent> e)
   // Note, though, that in this case we must move the event in `G` into
   // `U`: we've inserted `e` into the unfolding, so we expect it to be in `U`
   if (auto loc = std::find_if(G.begin(), G.end(), [=](const auto e_i) { return *e_i == *handle; }); loc != G.end()) {
-    const auto e_equiv = *loc;
+    const auto* e_equiv = *loc;
     G.remove(e_equiv);
     U.insert(e_equiv);
     return e_equiv;
@@ -66,7 +66,7 @@ const UnfoldingEvent* Unfolding::insert(std::unique_ptr<UnfoldingEvent> e)
 EventSet Unfolding::get_immediate_conflicts_of(const UnfoldingEvent* e) const
 {
   EventSet immediate_conflicts;
-  for (const auto event : U) {
+  for (const auto* event : U) {
     if (event->immediately_conflicts_with(e)) {
       immediate_conflicts.insert(event);
     }
index 30e1529..2e906cc 100644 (file)
@@ -24,8 +24,8 @@ TEST_CASE("simgrid::mc::udpor::Unfolding: Inserting and marking events with an u
       EventSet(), std::make_shared<ConditionallyDependentAction>(Transition::Type::UNKNOWN, 0));
   auto e2 =
       std::make_unique<UnfoldingEvent>(EventSet(), std::make_shared<DependentAction>(Transition::Type::UNKNOWN, 1));
-  const auto e1_handle = e1.get();
-  const auto e2_handle = e2.get();
+  auto* e1_handle = e1.get();
+  auto* e2_handle = e2.get();
 
   unfolding.insert(std::move(e1));
   REQUIRE(unfolding.size() == 1);
@@ -44,4 +44,4 @@ TEST_CASE("simgrid::mc::udpor::Unfolding: Inserting and marking events with an u
   REQUIRE_FALSE(unfolding.empty());
 }
 
-TEST_CASE("simgrid::mc::udpor::Unfolding: Checking all immediate conflicts restricted to an unfolding") {}
\ No newline at end of file
+TEST_CASE("simgrid::mc::udpor::Unfolding: Checking all immediate conflicts restricted to an unfolding") {}
index b613955..472855a 100644 (file)
@@ -162,7 +162,7 @@ maximal_subsets_iterator::Bookkeeper::find_next_candidate_event(topological_orde
 void maximal_subsets_iterator::Bookkeeper::mark_included_in_maximal_set(const UnfoldingEvent* e)
 {
   const auto e_local_config = e->get_local_config();
-  for (const auto e_hist : e_local_config) {
+  for (const auto* e_hist : e_local_config) {
     event_counts[e_hist]++;
   }
 }
@@ -170,7 +170,7 @@ void maximal_subsets_iterator::Bookkeeper::mark_included_in_maximal_set(const Un
 void maximal_subsets_iterator::Bookkeeper::mark_removed_from_maximal_set(const UnfoldingEvent* e)
 {
   const auto e_local_config = e->get_local_config();
-  for (const auto e_hist : e_local_config) {
+  for (const auto* e_hist : e_local_config) {
     xbt_assert(event_counts.find(e_hist) != event_counts.end(),
                "Invariant Violation: Attempted to remove an event which was not previously added");
     xbt_assert(event_counts[e_hist] > 0, "Invariant Violation: An event `e` had a count of `0` at this point "
index 211995b..4f16f57 100644 (file)
@@ -128,7 +128,7 @@ void CheckerSide::setup_events(bool socket_only)
   socket_event_ = event_new(
       base, get_channel().get_socket(), EV_READ | EV_PERSIST,
       [](evutil_socket_t, short events, void* arg) {
-        auto checker = static_cast<simgrid::mc::CheckerSide*>(arg);
+        auto* checker = static_cast<simgrid::mc::CheckerSide*>(arg);
         if (events == EV_READ) {
           do {
             std::array<char, MC_MESSAGE_LENGTH> buffer;
@@ -159,7 +159,7 @@ void CheckerSide::setup_events(bool socket_only)
     signal_event_ = event_new(
         base, SIGCHLD, EV_SIGNAL | EV_PERSIST,
         [](evutil_socket_t sig, short events, void* arg) {
-          auto checker = static_cast<simgrid::mc::CheckerSide*>(arg);
+          auto* checker = static_cast<simgrid::mc::CheckerSide*>(arg);
           if (events == EV_SIGNAL) {
             if (sig == SIGCHLD)
               checker->handle_waitpid();
index 029548d..03aeba8 100644 (file)
@@ -140,7 +140,7 @@ bool CommRecvTransition::depends(const Transition* other) const
     return true; // DEP with other send transitions
   }
 
-  if (auto* wait = dynamic_cast<const CommWaitTransition*>(other)) {
+  if (const auto* wait = dynamic_cast<const CommWaitTransition*>(other)) {
     if (wait->timeout_)
       return true;
 
index dbd39a5..a0c16de 100644 (file)
@@ -29,7 +29,7 @@ bool BarrierTransition::depends(const Transition* o) const
   if (o->type_ < type_)
     return o->depends(this);
 
-  if (auto* other = dynamic_cast<const BarrierTransition*>(o)) {
+  if (const auto* other = dynamic_cast<const BarrierTransition*>(o)) {
     if (bar_ != other->bar_)
       return false;
 
@@ -69,7 +69,7 @@ bool MutexTransition::depends(const Transition* o) const
 
   // type_ <= other->type_ in  MUTEX_LOCK, MUTEX_TEST, MUTEX_TRYLOCK, MUTEX_UNLOCK, MUTEX_WAIT,
 
-  if (auto* other = dynamic_cast<const MutexTransition*>(o)) {
+  if (const auto* other = dynamic_cast<const MutexTransition*>(o)) {
     // Theorem 4.4.7: Any pair of synchronization actions of distinct actors concerning distinct mutexes are independent
     if (mutex_ != other->mutex_)
       return false;
@@ -121,7 +121,7 @@ bool SemaphoreTransition::depends(const Transition* o) const
   if (o->type_ < type_)
     return o->depends(this);
 
-  if (auto* other = dynamic_cast<const SemaphoreTransition*>(o)) {
+  if (const auto* other = dynamic_cast<const SemaphoreTransition*>(o)) {
     if (sem_ != other->sem_)
       return false;
 
index 04810ee..3310cdb 100644 (file)
@@ -23,7 +23,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(cmonkey, kernel, "Chaos Monkey plugin");
 
 static void sg_chaos_monkey_plugin_run()
 {
-  auto engine = sg4::Engine::get_instance();
+  auto* engine = sg4::Engine::get_instance();
   auto hosts  = engine->get_all_hosts();
   auto links  = engine->get_all_links();
 
index d2f5dc8..aab32cb 100644 (file)
@@ -441,7 +441,7 @@ static void on_action_state_change(simgrid::kernel::resource::CpuAction const& a
  * (because the user changed the pstate, or because of external trace events) ("onSpeedChange") */
 static void on_host_change(simgrid::s4u::Host const& h)
 {
-  auto* host = &h;
+  const auto* host = &h;
   if (const auto* vm = dynamic_cast<simgrid::s4u::VirtualMachine const*>(host)) // Take the PM of virtual machines
     host = vm->get_pm();
 
@@ -475,8 +475,7 @@ static void on_simulation_end()
 
 static void on_activity_suspend_resume(simgrid::s4u::Activity const& activity)
 {
-  if (auto* action = dynamic_cast<simgrid::kernel::resource::CpuAction*>(activity.get_impl()->model_action_);
-      action != nullptr)
+  if (const auto* action = dynamic_cast<simgrid::kernel::resource::CpuAction*>(activity.get_impl()->model_action_))
     on_action_state_change(*action, /*ignored*/ action->get_state());
 }
 
@@ -555,7 +554,7 @@ static void ensure_plugin_inited()
 double sg_host_get_consumed_energy(const_sg_host_t host)
 {
   ensure_plugin_inited();
-  auto host_energy = host->extension<HostEnergy>();
+  auto* host_energy = host->extension<HostEnergy>();
   xbt_assert(host_energy->has_pstate_power_values(), "No power range properties specified for host %s",
              host->get_cname());
   return host_energy->get_consumed_energy();
@@ -609,7 +608,7 @@ double sg_host_get_power_range_slope_at(const_sg_host_t host, int pstate)
 double sg_host_get_current_consumption(const_sg_host_t host)
 {
   ensure_plugin_inited();
-  auto host_energy = host->extension<HostEnergy>();
+  auto* host_energy = host->extension<HostEnergy>();
   xbt_assert(host_energy->has_pstate_power_values(), "No power range properties specified for host %s",
              host->get_cname());
   return host_energy->get_current_watts_value();
index c0eb520..a19b720 100644 (file)
@@ -121,7 +121,7 @@ void HostLoad::update()
   // This loop updates the flops that the host executed for the ongoing computations
   auto iter = begin(current_activities);
   while (iter != end(current_activities)) {
-    auto& activity                         = iter->first;  // Just an alias
+    const auto& activity                   = iter->first;  // Just an alias
     auto& remaining_cost_after_last_update = iter->second; // Just an alias
     auto& action                           = activity->model_action_;
     auto current_iter                      = iter;
index 66ab5d3..e163799 100644 (file)
@@ -164,7 +164,7 @@ static void on_simulation_end()
 
 static void on_communication(const simgrid::s4u::Comm& comm)
 {
-  auto* pimpl = static_cast<simgrid::kernel::activity::CommImpl*>(comm.get_impl());
+  const auto* pimpl = static_cast<simgrid::kernel::activity::CommImpl*>(comm.get_impl());
   for (auto const* link : pimpl->get_traversed_links()) {
     if (link != nullptr && link->get_sharing_policy() != simgrid::s4u::Link::SharingPolicy::WIFI) {
       XBT_DEBUG("Update %s on Comm Start/End", link->get_cname());
index 3912fc9..ec2e84c 100644 (file)
@@ -268,7 +268,7 @@ using simgrid::plugin::LinkEnergyWifi;
 /* **************************** events  callback *************************** */
 static void on_communication(const simgrid::s4u::Comm& comm)
 {
-  auto* pimpl = static_cast<simgrid::kernel::activity::CommImpl*>(comm.get_impl());
+  const auto* pimpl = static_cast<simgrid::kernel::activity::CommImpl*>(comm.get_impl());
   for (auto const* link : pimpl->get_traversed_links()) {
     if (link != nullptr && link->get_sharing_policy() == simgrid::s4u::Link::SharingPolicy::WIFI) {
       auto* link_energy = link->extension<LinkEnergyWifi>();
index 8f0937d..d2df784 100644 (file)
@@ -164,7 +164,7 @@ using simgrid::plugin::LinkLoad;
 /* **************************** events  callback *************************** */
 static void on_communication(const simgrid::s4u::Comm& comm)
 {
-  auto* pimpl = static_cast<simgrid::kernel::activity::CommImpl*>(comm.get_impl());
+  const auto* pimpl = static_cast<simgrid::kernel::activity::CommImpl*>(comm.get_impl());
   for (auto const* link : pimpl->get_traversed_links()) {
     if (link != nullptr && link->get_sharing_policy() != simgrid::s4u::Link::SharingPolicy::WIFI) {
       auto* link_load = link->extension<LinkLoad>();
@@ -206,7 +206,7 @@ void sg_link_load_plugin_init()
 
   simgrid::s4u::Link::on_onoff_cb([](simgrid::s4u::Link const& link) {
     if (link.get_sharing_policy() != simgrid::s4u::Link::SharingPolicy::WIFI) {
-      auto link_load = link.extension<LinkLoad>();
+      auto* link_load = link.extension<LinkLoad>();
       if (link_load->is_tracked())
         link_load->update();
     }
@@ -215,7 +215,7 @@ void sg_link_load_plugin_init()
                                                           simgrid::kernel::resource::Action::State /* previous */) {
     for (auto const* link : action.get_links()) {
       if (link != nullptr && link->get_sharing_policy() != simgrid::s4u::Link::SharingPolicy::WIFI) {
-        auto link_load = link->get_iface()->extension<LinkLoad>();
+        auto* link_load = link->get_iface()->extension<LinkLoad>();
         if (link_load->is_tracked())
           link_load->update();
       }
index 8160068..7fdee49 100644 (file)
@@ -76,7 +76,7 @@ static void on_virtual_machine_creation(const simgrid::s4u::VirtualMachine& vm)
 
 static void on_exec_creation(simgrid::s4u::Exec const& e)
 {
-  auto exec                              = static_cast<simgrid::kernel::activity::ExecImpl*>(e.get_impl());
+  auto* exec                             = static_cast<simgrid::kernel::activity::ExecImpl*>(e.get_impl());
   const simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(exec->get_host());
   if (vm == nullptr)
     return;
index a6ada2f..ac97c56 100644 (file)
@@ -468,7 +468,7 @@ ssize_t Comm::wait_any_for(const std::vector<CommPtr>& comms, double timeout)
 void Comm::wait_all(const std::vector<CommPtr>& comms)
 {
   // TODO: this should be a simcall or something
-  for (auto& comm : comms)
+  for (const auto& comm : comms)
     comm->wait();
 }
 
index a782de7..a76ed63 100644 (file)
@@ -76,7 +76,7 @@ Engine* Engine::get_instance()
 Engine* Engine::get_instance(int* argc, char** argv)
 {
   if (Engine::instance_ == nullptr) {
-    auto e = new Engine(argc, argv);
+    auto* e = new Engine(argc, argv);
     xbt_assert(Engine::instance_ == e);
   }
   return Engine::instance_;
@@ -525,7 +525,7 @@ kernel::routing::NetPoint* Engine::netpoint_by_name_or_null(const std::string& n
 
 kernel::routing::NetPoint* Engine::netpoint_by_name(const std::string& name) const
 {
-  auto netp = netpoint_by_name_or_null(name);
+  auto* netp = netpoint_by_name_or_null(name);
   if (netp == nullptr) {
     throw std::invalid_argument("Netpoint not found: " + name);
   }
index 356524b..139baf6 100644 (file)
@@ -39,7 +39,7 @@ void NetZone::set_property(const std::string& key, const std::string& value)
 std::vector<NetZone*> NetZone::get_children() const
 {
   std::vector<NetZone*> res;
-  for (auto child : pimpl_->get_children())
+  for (auto* child : pimpl_->get_children())
     res.push_back(child->get_iface());
   return res;
 }
index 3168044..93dca48 100644 (file)
@@ -136,9 +136,9 @@ int PMPI_Abort(MPI_Comm comm, int /*errorcode*/)
   smpi_bench_end();
   CHECK_COMM(1)
   XBT_WARN("MPI_Abort was called, something went probably wrong in this simulation ! Killing all processes sharing the same MPI_COMM_WORLD");
-  auto myself = simgrid::kernel::actor::ActorImpl::self();
+  auto* myself = simgrid::kernel::actor::ActorImpl::self();
   for (int i = 0; i < comm->size(); i++){
-    auto actor = simgrid::kernel::EngineImpl::get_instance()->get_actor_by_pid(comm->group()->actor(i));
+    auto* actor = simgrid::kernel::EngineImpl::get_instance()->get_actor_by_pid(comm->group()->actor(i));
     if (actor != nullptr && actor != myself)
       simgrid::kernel::actor::simcall_answered([actor] { actor->exit(); });
   }
index 993c728..560e030 100644 (file)
@@ -147,7 +147,7 @@ void TRACE_smpi_init(aid_t pid, const std::string& calling_func)
   if (not TRACE_smpi_is_enabled())
     return;
 
-  auto self = simgrid::s4u::Actor::self();
+  auto* self = simgrid::s4u::Actor::self();
 
   TRACE_smpi_setup_container(pid, sg_host_self());
   simgrid::s4u::this_actor::on_exit([self](bool) { smpi_container(self->get_pid())->remove_from_parent(); });
index fdfcb18..77ea460 100644 (file)
@@ -52,7 +52,7 @@ void smpi_prepare_global_memory_segment()
 
 static void smpi_get_executable_global_size()
 {
-  auto* binary_name = simgrid::kernel::EngineImpl::get_instance()->get_cmdline().front().c_str();
+  const auto* binary_name = simgrid::kernel::EngineImpl::get_instance()->get_cmdline().front().c_str();
   char* buffer      = realpath(binary_name, nullptr);
   xbt_assert(buffer != nullptr, "Could not resolve real path of binary file '%s'", binary_name);
   std::string full_name = buffer;
@@ -95,7 +95,7 @@ static void* asan_safe_memcpy(void* dest, void* src, size_t n)
     while (i < n && __asan_address_is_poisoned(psrc + i))
       ++i;
     if (i < n) {
-      char* p  = static_cast<char*>(__asan_region_is_poisoned(psrc + i, n - i));
+      const char* p = static_cast<char*>(__asan_region_is_poisoned(psrc + i, n - i));
       size_t j = p ? (p - psrc) : n;
       memcpy(pdest + i, psrc + i, j - i);
       i = j;
index c743864..6c149d3 100644 (file)
@@ -117,7 +117,7 @@ public:
   {
     for (auto const& [_, reqs] : store) {
       aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
-      for (auto& req: reqs){
+      for (const auto& req : reqs) {
         if (req != MPI_REQUEST_NULL && (req->src() == my_proc_id || req->dst() == my_proc_id)) {
           vec.push_back(req);
           req->print_request("MM");
@@ -920,7 +920,7 @@ void smpi_replay_main(int rank, const char* private_trace_filename)
     unsigned int i=0;
 
     for (auto const& [_, reqs] : storage[simgrid::s4u::this_actor::get_pid()].get_store()) {
-      for (auto& req : reqs) {
+      for (const auto& req : reqs) {
         requests[i] = req; // FIXME: overwritten at each iteration?
       }
       i++;
index 6b58173..e62c37d 100644 (file)
@@ -181,8 +181,8 @@ void Request::init_buffer(int count){
 
 bool Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 {
-  auto ref = static_cast<MPI_Request>(a);
-  auto req = static_cast<MPI_Request>(b);
+  auto* ref  = static_cast<MPI_Request>(a);
+  auto* req  = static_cast<MPI_Request>(b);
   bool match = match_common(req, req, ref);
   if (not match || ref->comm_ == MPI_COMM_UNINITIALIZED || ref->comm_->is_smp_comm())
     return match;
@@ -216,8 +216,8 @@ bool Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 
 bool Request::match_send(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 {
-  auto ref = static_cast<MPI_Request>(a);
-  auto req = static_cast<MPI_Request>(b);
+  auto* ref = static_cast<MPI_Request>(a);
+  auto* req = static_cast<MPI_Request>(b);
   return match_common(req, ref, req);
 }
 
@@ -323,9 +323,9 @@ MPI_Request Request::irecv_init(void *buf, int count, MPI_Datatype datatype, int
 
 MPI_Request Request::ibsend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
-                             dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
-                             MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SEND | MPI_REQ_BSEND);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                              dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
+                              MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SEND | MPI_REQ_BSEND);
   if(dst != MPI_PROC_NULL)
     request->start();
   return request;
@@ -333,9 +333,9 @@ MPI_Request Request::ibsend(const void *buf, int count, MPI_Datatype datatype, i
 
 MPI_Request Request::isend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
-                             dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
-                             MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SEND);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                              dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
+                              MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SEND);
   if(dst != MPI_PROC_NULL)
     request->start();
   return request;
@@ -343,9 +343,9 @@ MPI_Request Request::isend(const void *buf, int count, MPI_Datatype datatype, in
 
 MPI_Request Request::issend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
-                             dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
-                             MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SSEND | MPI_REQ_SEND);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                              dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
+                              MPI_REQ_NON_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SSEND | MPI_REQ_SEND);
   if(dst != MPI_PROC_NULL)
     request->start();
   return request;
@@ -358,8 +358,8 @@ MPI_Request Request::irecv(void *buf, int count, MPI_Datatype datatype, int src,
     source = MPI_ANY_SOURCE;
   else if (src != MPI_PROC_NULL)
     source = comm->group()->actor(src);
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, source,
-                             simgrid::s4u::this_actor::get_pid(), tag, comm, MPI_REQ_NON_PERSISTENT | MPI_REQ_RECV);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, source,
+                              simgrid::s4u::this_actor::get_pid(), tag, comm, MPI_REQ_NON_PERSISTENT | MPI_REQ_RECV);
   if(src != MPI_PROC_NULL)
     request->start();
   return request;
@@ -374,9 +374,9 @@ int Request::recv(void *buf, int count, MPI_Datatype datatype, int src, int tag,
 
 void Request::bsend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
-                             dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
-                             MPI_REQ_NON_PERSISTENT | MPI_REQ_SEND | MPI_REQ_BSEND);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                              dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
+                              MPI_REQ_NON_PERSISTENT | MPI_REQ_SEND | MPI_REQ_BSEND);
 
   if(dst != MPI_PROC_NULL)
    request->start();
@@ -385,9 +385,9 @@ void Request::bsend(const void *buf, int count, MPI_Datatype datatype, int dst,
 
 void Request::send(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
-                             dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
-                             MPI_REQ_NON_PERSISTENT | MPI_REQ_SEND);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                              dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
+                              MPI_REQ_NON_PERSISTENT | MPI_REQ_SEND);
   if(dst != MPI_PROC_NULL)
    request->start();
   wait(&request, MPI_STATUS_IGNORE);
@@ -395,9 +395,9 @@ void Request::send(const void *buf, int count, MPI_Datatype datatype, int dst, i
 
 void Request::ssend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
 {
-  auto request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
-                             dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
-                             MPI_REQ_NON_PERSISTENT | MPI_REQ_SSEND | MPI_REQ_SEND);
+  auto* request = new Request(buf == MPI_BOTTOM ? nullptr : buf, count, datatype, simgrid::s4u::this_actor::get_pid(),
+                              dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL, tag, comm,
+                              MPI_REQ_NON_PERSISTENT | MPI_REQ_SSEND | MPI_REQ_SEND);
 
   if(dst != MPI_PROC_NULL)
    request->start();
@@ -857,7 +857,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   static int nsleeps = 1;
   double speed        = s4u::this_actor::get_host()->get_speed();
   double maxrate      = smpi_cfg_iprobe_cpu_usage();
-  auto request =
+  auto* request =
       new Request(nullptr, 0, MPI_CHAR, source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->actor(source),
                   simgrid::s4u::this_actor::get_pid(), tag, comm, MPI_REQ_PERSISTENT | MPI_REQ_RECV | MPI_REQ_PROBE);
   if (smpi_iprobe_sleep > 0) {
index 6a0738d..703ae54 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char* argv[])
     return 1;
   }
 
-  auto properties = simgrid::s4u::Actor::self()->get_properties();
+  const auto* properties = simgrid::s4u::Actor::self()->get_properties();
   if (properties->find("smpi_replay") == properties->end()) {
     XBT_ERROR("invalid smpireplaymain execution. Please use smpirun -replay instead.");
     return 1;
index 0c28bac..84049fa 100644 (file)
@@ -18,7 +18,7 @@ TEST_CASE("xbt::config: Configuration support", "config")
   XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(xbt_cfg);
   xbt_log_threshold_set(&_XBT_LOGV(xbt_cfg), xbt_log_priority_critical);
 
-  auto temp      = simgrid_config;
+  auto* temp     = simgrid_config;
   simgrid_config = nullptr;
   simgrid::config::declare_flag<int>("speed", "description", 0);
   simgrid::config::alias("speed", {"velocity"});
index e8048f8..e4d1755 100644 (file)
@@ -35,7 +35,7 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio
   try {
     std::string name = boost::core::demangle(typeid(exception).name());
 
-    auto* with_context = dynamic_cast<const simgrid::Exception*>(&exception);
+    const auto* with_context = dynamic_cast<const simgrid::Exception*>(&exception);
     if (with_context != nullptr) {
       XBT_LOG(prio, "%s %s by %s/%ld: %s", context, name.c_str(), with_context->throw_point().procname_.c_str(),
               with_context->throw_point().pid_, exception.what());
@@ -54,7 +54,7 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio
 
   try {
     // Do we have a nested exception?
-    auto* with_nested = dynamic_cast<const std::nested_exception*>(&exception);
+    const auto* with_nested = dynamic_cast<const std::nested_exception*>(&exception);
     if (with_nested != nullptr && with_nested->nested_ptr() != nullptr)
       with_nested->rethrow_nested();
   } catch (const std::exception& nested_exception) {
index 7c02fa1..2835abe 100644 (file)
@@ -282,7 +282,7 @@ template <typename T> typename Parmap<T>::Synchro* Parmap<T>::new_synchro(e_xbt_
 /** @brief Main function of a worker thread */
 template <typename T> void Parmap<T>::worker_main(ThreadData* data)
 {
-  auto engine                       = simgrid::kernel::EngineImpl::get_instance();
+  const auto* engine                = simgrid::kernel::EngineImpl::get_instance();
   Parmap<T>& parmap                 = data->parmap;
   unsigned round                    = 0;
   kernel::context::Context* context = engine->get_context_factory()->create_context(std::function<void()>(), nullptr);
index 59c95ae..7e71267 100644 (file)
@@ -26,7 +26,7 @@ TEST_CASE("simgrid::xbt::subsets_iterator: Iteration General Properties")
   SECTION("Each element of each subset is distinct")
   {
     for (unsigned k = 0; static_cast<size_t>(k) < example_vec.size(); k++) {
-      for (auto& subset : make_k_subsets_iter(k, example_vec)) {
+      for (const auto& subset : make_k_subsets_iter(k, example_vec)) {
         // Each subset must have size `k`
         REQUIRE(subset.size() == k);
 
@@ -54,7 +54,7 @@ TEST_CASE("simgrid::xbt::powerset_iterator: Iteration General Properties")
 
     std::unordered_map<int, int> element_counts(k);
 
-    for (auto& subset : make_powerset_iter(example_vec)) {
+    for (const auto& subset : make_powerset_iter(example_vec)) {
       // Each subset must be comprised only of distinct elements
       std::unordered_set<int> elements_seen(k);
       for (const auto& element_ptr : subset) {
index aa86545..05f3d2e 100644 (file)
@@ -96,9 +96,9 @@ static const simgrid::mc::Variable* test_global_variable(const simgrid::mc::Remo
   return variable;
 }
 
-static simgrid::mc::Member* find_member(simgrid::mc::Type& type, const char* name)
+static const simgrid::mc::Member* find_member(const simgrid::mc::Type& type, const char* name)
 {
-  for (simgrid::mc::Member& member : type.members)
+  for (const simgrid::mc::Member& member : type.members)
     if(member.name == name)
       return &member;
   return nullptr;
index adb9519..8f98636 100644 (file)
@@ -30,7 +30,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(mutex_handling, "Messages specific for this test");
 
 static int receiver(const char* box_name)
 {
-  auto mb = simgrid::s4u::Mailbox::by_name(box_name);
+  auto* mb = simgrid::s4u::Mailbox::by_name(box_name);
   std::unique_ptr<int> payload;
 
   payload = mb->get_unique<int>();
@@ -45,7 +45,7 @@ static int receiver(const char* box_name)
 static int sender(const char* box_name, simgrid::s4u::MutexPtr mutex, int value)
 {
   auto* payload = new int(value);
-  auto mb      = simgrid::s4u::Mailbox::by_name(box_name);
+  auto* mb      = simgrid::s4u::Mailbox::by_name(box_name);
 
   std::unique_lock<simgrid::s4u::Mutex> lock;
   if (mutex)
index 4b9d72f..769763b 100644 (file)
@@ -123,7 +123,7 @@ TEST_CASE("Activity lifecycle: direct communication (sendto) activities")
     });
 
     simgrid::s4u::this_actor::yield();
-    auto link = simgrid::s4u::Engine::get_instance()->link_by_name("link1");
+    auto* link = simgrid::s4u::Engine::get_instance()->link_by_name("link1");
     link->turn_off();
     link->turn_on();
 
@@ -139,7 +139,7 @@ TEST_CASE("Activity lifecycle: direct communication (sendto) activities")
     });
 
     simgrid::s4u::this_actor::sleep_for(2);
-    auto link = simgrid::s4u::Engine::get_instance()->link_by_name("link1");
+    auto* link = simgrid::s4u::Engine::get_instance()->link_by_name("link1");
     link->turn_off();
     link->turn_on();
 
@@ -160,7 +160,7 @@ TEST_CASE("Activity lifecycle: direct communication (sendto) activities")
     simgrid::s4u::Actor::create("killer", all_hosts[0], []() {
       simgrid::s4u::this_actor::sleep_for(5);
       XBT_VERB("Killer!");
-      auto link = simgrid::s4u::Engine::get_instance()->link_by_name("link1");
+      auto* link = simgrid::s4u::Engine::get_instance()->link_by_name("link1");
       link->turn_off();
       link->turn_on();
     });
index ed4d1ed..91aad4d 100644 (file)
@@ -19,7 +19,7 @@ public:
   void operator()() const
   {
     XBT_INFO("Starting.");
-    auto mailbox = simgrid::s4u::Mailbox::by_name("receiver");
+    auto* mailbox = simgrid::s4u::Mailbox::by_name("receiver");
     int data     = *mailbox->get<int>();
     XBT_INFO("Got %d at the end", data);
   }
@@ -42,7 +42,7 @@ public:
     simgrid::s4u::this_actor::sleep_for(10);
 
     XBT_INFO("Sending a message to the receiver...");
-    auto mailbox = simgrid::s4u::Mailbox::by_name("receiver");
+    auto* mailbox   = simgrid::s4u::Mailbox::by_name("receiver");
     static int data = 42;
     mailbox->put(&data, 4);
 
index d81bce5..140d969 100644 (file)
@@ -23,7 +23,7 @@ int main(int argc, char** argv)
   simgrid::s4u::Engine e(&argc, argv);
   e.load_platform(argv[1]);
 
-  auto host = e.host_by_name("cpu0");
+  auto* host = e.host_by_name("cpu0");
   /* creation of the tasks and their dependencies */
   simgrid::s4u::ExecPtr Init = simgrid::s4u::Exec::init()->set_name("Init")->set_flops_amount(0)->start();
   simgrid::s4u::CommPtr A = simgrid::s4u::Comm::sendto_init()->set_name("A")->set_payload_size(1e9)->start();
index c1d70c4..c0279d4 100644 (file)
@@ -39,7 +39,7 @@ static void commRX()
 {
   XBT_INFO("  Start RX");
   try {
-    auto payload = simgrid::s4u::Mailbox::by_name("comm")->get<std::string>();
+    auto* payload = simgrid::s4u::Mailbox::by_name("comm")->get<std::string>();
     XBT_INFO("  Receive message: %s", payload->c_str());
   } catch (const simgrid::HostFailureException&) {
     XBT_INFO("  Receive message: HOST_FAILURE");
index e3833b2..7b5ed74 100644 (file)
@@ -9,7 +9,7 @@
 
 static void runner()
 {
-  auto e                    = simgrid::s4u::Engine::get_instance();
+  auto* e                   = simgrid::s4u::Engine::get_instance();
   simgrid::s4u::Host* host0 = e->host_by_name("c1_0");
   simgrid::s4u::Host* host1 = e->host_by_name("c2_0");
 
index 8d66af5..a3315e6 100644 (file)
@@ -25,7 +25,7 @@ public:
     for (const auto* host : hosts_) {
       auto* payload = new std::string(msg_content);
       /* Create a communication representing the ongoing communication, and store it in pending_comms */
-      auto mbox = sg4::Mailbox::by_name(host->get_name());
+      auto* mbox = sg4::Mailbox::by_name(host->get_name());
       mboxes.push_back(mbox);
       sg4::CommPtr comm = mbox->put_async(payload, msg_size);
       pending_comms.push_back(comm);
@@ -45,7 +45,7 @@ class Receiver {
 public:
   void operator()() const
   {
-    auto mbox     = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
+    auto* mbox    = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
     auto received = mbox->get_unique<std::string>();
     XBT_INFO("I got a '%s'.", received->c_str());
 
index ea4efa1..4f0c3d0 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(meh, "meh");
 
 static void worker()
 {
-  auto mbox  = simgrid::s4u::Mailbox::by_name("meh");
+  auto* mbox = simgrid::s4u::Mailbox::by_name("meh");
   int input1 = 42;
   int input2 = 51;
 
index c7b689b..8eae452 100644 (file)
@@ -12,7 +12,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(meh, "meh");
 
 static void worker()
 {
-  auto mbox = simgrid::s4u::Mailbox::by_name("meh");
+  auto* mbox = simgrid::s4u::Mailbox::by_name("meh");
   int input1 = 42;
   int input2 = 51;