Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authormlaurent <mathieu.laurent@ens-rennes.fr>
Wed, 7 Jun 2023 10:46:36 +0000 (12:46 +0200)
committermlaurent <mathieu.laurent@ens-rennes.fr>
Wed, 7 Jun 2023 10:46:36 +0000 (12:46 +0200)
19 files changed:
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
include/simgrid/plugins/task.hpp
include/simgrid/s4u/Comm.hpp
src/instr/instr_platform.cpp
src/kernel/activity/SemaphoreImpl.cpp
src/kernel/resource/WifiLinkImpl.cpp
src/mc/explo/odpor/WakeupTreeIterator.hpp
src/mc/explo/udpor/Configuration_test.cpp
src/mc/explo/udpor/Unfolding_test.cpp
src/plugins/chaos_monkey.cpp
src/plugins/vm/dirty_page_tracking.cpp
src/s4u/s4u_Engine.cpp
src/smpi/internals/instr_smpi.cpp
teshsuite/mc/dwarf/dwarf.cpp
teshsuite/s4u/host-on-off-actors/host-on-off-actors.cpp
teshsuite/s4u/issue71/issue71.cpp
tools/graphicator/graphicator.cpp

index 08b01f3..e4ec699 100644 (file)
@@ -11,7 +11,7 @@ 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.
index 8cfad72..e7a17cb 100644 (file)
@@ -10,7 +10,7 @@ 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.
index 8a16b5e..1de40a2 100644 (file)
@@ -11,7 +11,7 @@ namespace sg4 = simgrid::s4u;
 
 static void runner()
 {
-  auto* e                   = sg4::Engine::get_instance();
+  const 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 62eb12a..8143333 100644 (file)
@@ -134,9 +134,9 @@ public:
   IoTaskPtr set_disk(s4u::Disk* disk);
   s4u::Disk* get_disk() const { return disk_; }
   IoTaskPtr set_bytes(double bytes);
-  double get_bytes() { return get_amount(); }
+  double get_bytes() const { return get_amount(); }
   IoTaskPtr set_op_type(s4u::Io::OpType type);
-  s4u::Io::OpType get_op_type() { return type_; }
+  s4u::Io::OpType get_op_type() const { return type_; }
 };
 } // namespace simgrid::plugins
 #endif
index 2f07115..a92f87f 100644 (file)
@@ -68,7 +68,7 @@ public:
   /*! \static Add a callback fired when the send of any Comm is posted  */
   static void on_send_cb(const std::function<void(Comm const&)>& cb) { on_send.connect(cb); }
   /*! Add a callback fired when the send of this specific Comm is posted  */
-  void on_this_send_cb(const std::function<void(Comm const&)>& cb) { on_send.connect(cb); }
+  void on_this_send_cb(const std::function<void(Comm const&)>& cb) { on_this_send.connect(cb); }
   /*! \static Add a callback fired when the recv of any Comm is posted  */
   static void on_recv_cb(const std::function<void(Comm const&)>& cb) { on_recv.connect(cb); }
   /*! Add a callback fired when the recv of this specific Comm is posted  */
index 1519f80..f7cbcc9 100644 (file)
@@ -531,10 +531,10 @@ void define_callbacks()
         Container::by_name(c.get_destination()->get_name())->get_state("HOST_STATE")->push_event("start");
       }
     });
-    s4u::Comm::on_send_cb([](s4u::Comm const& c) {
+    s4u::Comm::on_send_cb([](s4u::Comm const&) {
       Container::by_name(instr_pid(*s4u::Actor::self()))->get_state("ACTOR_STATE")->push_event("send");
     });
-    s4u::Comm::on_recv_cb([](s4u::Comm const& c) {
+    s4u::Comm::on_recv_cb([](s4u::Comm const&) {
       Container::by_name(instr_pid(*s4u::Actor::self()))->get_state("ACTOR_STATE")->push_event("receive");
     });
     s4u::Actor::on_host_change_cb(on_actor_host_change);
index dc7ccbe..b53f457 100644 (file)
@@ -68,7 +68,7 @@ void SemAcquisitionImpl::finish()
 void SemAcquisitionImpl::cancel()
 {
   /* Remove myself from the list of interested parties */
-  auto* issuer = get_issuer();
+  const 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 b0abe21..a40a12a 100644 (file)
@@ -18,7 +18,7 @@ namespace simgrid::kernel::resource {
  ************/
 static void update_bw_comm_start(const s4u::Comm& comm)
 {
-  auto* pimpl = static_cast<activity::CommImpl*>(comm.get_impl());
+  const auto* pimpl = static_cast<activity::CommImpl*>(comm.get_impl());
 
   auto const* actionWifi = dynamic_cast<const kernel::resource::WifiLinkAction*>(pimpl->model_action_);
   if (actionWifi == nullptr)
index 0ccc6bc..e42184c 100644 (file)
@@ -29,7 +29,12 @@ namespace simgrid::mc::odpor {
 class WakeupTreeIterator
     : public boost::iterator_facade<WakeupTreeIterator, WakeupTreeNode*, boost::forward_traversal_tag> {
 public:
-  WakeupTreeIterator() = default;
+  // Use rule-of-three, and implicitely disable the move constructor which cannot be 'noexcept' (as required by C++ Core
+  // Guidelines), due to the std::list and std:stack<std::deque> members.
+  WakeupTreeIterator()                          = default;
+  WakeupTreeIterator(const WakeupTreeIterator&) = default;
+  ~WakeupTreeIterator()                         = default;
+
   explicit WakeupTreeIterator(const WakeupTree& tree);
 
 private:
index 0d2217f..dc3d900 100644 (file)
@@ -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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const 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();
+  const auto* e10_handle = e10.get();
 
   SECTION("Alternative computation call 1")
   {
index 2e906cc..5ee5df2 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));
-  auto* e1_handle = e1.get();
-  auto* e2_handle = e2.get();
+  const auto* e1_handle = e1.get();
+  const auto* e2_handle = e2.get();
 
   unfolding.insert(std::move(e1));
   REQUIRE(unfolding.size() == 1);
index 3310cdb..282bcd5 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();
+  const auto* engine = sg4::Engine::get_instance();
   auto hosts  = engine->get_all_hosts();
   auto links  = engine->get_all_links();
 
index 7fdee49..d30a1b0 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());
+  const 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 a76ed63..11b8b48 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);
+    const auto* e = new Engine(argc, argv);
     xbt_assert(Engine::instance_ == e);
   }
   return Engine::instance_;
index 560e030..63e8f33 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();
+  const 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 05f3d2e..d4d513e 100644 (file)
@@ -120,7 +120,7 @@ int main(int argc, char** argv)
   simgrid::s4u::Engine::get_instance(&argc, argv);
 
   const simgrid::mc::Variable* var;
-  simgrid::mc::Type* type;
+  const simgrid::mc::Type* type;
 
   simgrid::mc::RemoteProcessMemory process(getpid(), nullptr);
 
index c0279d4..fcc42cb 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>();
+    const 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 7b5ed74..7983e49 100644 (file)
@@ -9,7 +9,7 @@
 
 static void runner()
 {
-  auto* e                   = simgrid::s4u::Engine::get_instance();
+  const 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 dbcb6e0..368892b 100644 (file)
@@ -26,7 +26,7 @@ int main(int argc, char** argv)
     simgrid::instr::platform_graph_export_graphviz(outputfile);
   }
   else {
-    xbt_assert(false, "Unknown output file format, please use '.dot' or .csv' extension\n");
+    xbt_die("Unknown output file format, please use '.dot' or .csv' extension");
   }
   return 0;
 }