Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #374 from adegomme/master
authorMartin Quinson <624847+mquinson@users.noreply.github.com>
Thu, 11 Mar 2021 16:13:33 +0000 (17:13 +0100)
committerGitHub <noreply@github.com>
Thu, 11 Mar 2021 16:13:33 +0000 (17:13 +0100)
try to handle inconsistencies in github environments.

14 files changed:
examples/cpp/exec-ptask-multicore/s4u-exec-ptask-multicore.cpp
include/simgrid/s4u/Engine.hpp
src/s4u/s4u_Engine.cpp
src/surf/cpu_cas01.hpp
src/surf/disk_s19.cpp
src/surf/disk_s19.hpp
src/surf/host_clm03.cpp
src/surf/host_clm03.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp
teshsuite/surf/surf_usage/surf_usage.cpp
teshsuite/surf/surf_usage2/surf_usage2.cpp

index 1062709..24b9e01 100644 (file)
@@ -16,19 +16,19 @@ static void runner()
   std::vector<double> comm(4, 0.0);
   // Different hosts.
   std::vector<sg4::Host*> hosts_diff = {e->host_by_name("MyHost2"), e->host_by_name("MyHost3")};
-  double start_time                  = e->get_clock();
+  double start_time                  = sg4::Engine::get_clock();
   sg4::this_actor::parallel_execute(hosts_diff, comp, comm);
   XBT_INFO("Computed 2-core activity on two different hosts. Took %g s", e->get_clock() - start_time);
 
   // Same host, monocore.
   std::vector<sg4::Host*> monocore_hosts = {e->host_by_name("MyHost2"), e->host_by_name("MyHost2")};
-  start_time                             = e->get_clock();
+  start_time                             = sg4::Engine::get_clock();
   sg4::this_actor::parallel_execute(monocore_hosts, comp, comm);
   XBT_INFO("Computed 2-core activity one 1-core host. Took %g s", e->get_clock() - start_time);
 
   // Same host, multicore.
   std::vector<sg4::Host*> multicore_host = {e->host_by_name("MyHost1"), e->host_by_name("MyHost1")};
-  start_time                             = e->get_clock();
+  start_time                             = sg4::Engine::get_clock();
   sg4::this_actor::parallel_execute(multicore_host, comp, comm);
   XBT_INFO("Computed 2-core activity on one 2-core host. Took %g s", e->get_clock() - start_time);
 
@@ -36,7 +36,7 @@ static void runner()
   std::vector<double> comp6(6, 1e9);
   std::vector<double> comm6(36, 0.0);
   std::vector<sg4::Host*> multicore_overload(6, e->host_by_name("MyHost1"));
-  start_time = e->get_clock();
+  start_time = sg4::Engine::get_clock();
   sg4::this_actor::parallel_execute(multicore_overload, comp6, comm6);
   XBT_INFO("Computed 6-core activity of a 4-core host. Took %g s", e->get_clock() - start_time);
 }
index 9397c3f..89ea5a5 100644 (file)
@@ -142,7 +142,7 @@ public:
   const std::vector<simgrid::kernel::resource::Model*>& get_model_list(simgrid::kernel::resource::Model::Type type);
 
   /** @brief Get list of all models managed by this engine */
-  const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models();
+  const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& get_all_models() const;
 
   /** @brief Retrieves all netzones of the type indicated by the template argument */
   template <class T> std::vector<T*> get_filtered_netzones() const
index 9959d37..054c00e 100644 (file)
@@ -85,7 +85,7 @@ const std::vector<simgrid::kernel::resource::Model*>& Engine::get_model_list(sim
   return pimpl->get_model_list(type);
 }
 
-const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models()
+const std::vector<std::shared_ptr<simgrid::kernel::resource::Model>>& Engine::get_all_models() const
 {
   return pimpl->get_all_models();
 }
index fb23d35..4c42e85 100644 (file)
@@ -40,7 +40,7 @@ public:
 
 class CpuCas01 : public Cpu {
 public:
-  CpuCas01(s4u::Host* host, const std::vector<double>& speed_per_pstate) : Cpu(host, speed_per_pstate) {}
+  using Cpu::Cpu;
   CpuCas01(const CpuCas01&) = delete;
   CpuCas01& operator=(const CpuCas01&) = delete;
   void apply_event(profile::Event* event, double value) override;
index 5735522..c39c8f9 100644 (file)
@@ -29,10 +29,6 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
-DiskS19Model::DiskS19Model()
-{
-}
-
 DiskImpl* DiskS19Model::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
   return (new DiskS19(name, read_bandwidth, write_bandwidth))->set_model(this);
index feea129..63ae718 100644 (file)
@@ -28,7 +28,7 @@ class XBT_PRIVATE DiskS19Action;
 
 class DiskS19Model : public DiskModel {
 public:
-  DiskS19Model();
+  DiskS19Model() = default;
   DiskImpl* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) override;
   double next_occurring_event(double now) override;
   void update_actions_state(double now, double delta) override;
index ed428d4..fb5bab9 100644 (file)
@@ -30,10 +30,6 @@ void surf_host_model_init_compound()
 
 namespace simgrid {
 namespace surf {
-HostCLM03Model::HostCLM03Model()
-{
-}
-
 double HostCLM03Model::next_occurring_event(double now)
 {
   /* nothing specific to be done here
index ad4f589..42a442b 100644 (file)
@@ -17,7 +17,7 @@ namespace surf {
 
 class XBT_PRIVATE HostCLM03Model : public HostModel {
 public:
-  HostCLM03Model();
+  HostCLM03Model() = default;
   double next_occurring_event(double now) override;
   void update_actions_state(double now, double delta) override;
   kernel::resource::Action* execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
index c87e5e0..31147f7 100644 (file)
@@ -113,7 +113,7 @@ s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() const
   return get_constraint()->get_sharing_policy();
 }
 
-void LinkImpl::latency_check(double latency)
+void LinkImpl::latency_check(double latency) const
 {
   static double last_warned_latency = sg_surf_precision;
   if (latency != 0.0 && latency < last_warned_latency) {
index ea4880a..925db91 100644 (file)
@@ -118,7 +118,7 @@ protected:
 public:
   void destroy(); // Must be called instead of the destructor
 
-  void latency_check(double latency);
+  void latency_check(double latency) const;
 
   /** @brief Public interface */
   const s4u::Link* get_iface() const { return &piface_; }
index 2eb2254..dbb89d7 100644 (file)
@@ -42,8 +42,6 @@ HostL07Model::HostL07Model() : HostModel()
   engine->add_model(simgrid::kernel::resource::Model::Type::CPU_PM, std::move(cpu_model), true);
 }
 
-HostL07Model::~HostL07Model() {}
-
 CpuL07Model::CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys)
     : CpuModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
 {
index a2192e1..cf70d56 100644 (file)
@@ -38,7 +38,6 @@ public:
   HostL07Model();
   HostL07Model(const HostL07Model&) = delete;
   HostL07Model& operator=(const HostL07Model&) = delete;
-  ~HostL07Model() override;
 
   double next_occurring_event(double now) override;
   void update_actions_state(double now, double delta) override;
@@ -52,10 +51,11 @@ public:
   CpuL07Model(const CpuL07Model&) = delete;
   CpuL07Model& operator=(const CpuL07Model&) = delete;
   ~CpuL07Model() override;
-  /* this action is done by HostL07Model which shares the LMM system with the CPU model
-   * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
-   * method in surf_presolve */
-  void update_actions_state(double now, double delta) override{};
+  void update_actions_state(double /*now*/, double /*delta*/) override{
+      /* this action is done by HostL07Model which shares the LMM system with the CPU model
+       * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
+       * method in surf_presolve */
+  };
 
   kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate) override;
   HostL07Model* hostModel_;
@@ -71,10 +71,11 @@ public:
                                           s4u::Link::SharingPolicy policy) override;
 
   kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
-  /* this action is done by HostL07Model which shares the LMM system with the CPU model
-   * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
-   * method in surf_presolve */
-  void update_actions_state(double now, double delta) override{};
+  void update_actions_state(double /*now*/, double /*delta*/) override{
+      /* this action is done by HostL07Model which shares the LMM system with the CPU model
+       * Overriding to an empty function here allows us to handle the Cpu07Model as a regular
+       * method in surf_presolve */
+  };
 
   HostL07Model* hostModel_;
 };
@@ -85,7 +86,7 @@ public:
 
 class CpuL07 : public kernel::resource::Cpu {
 public:
-  CpuL07(s4u::Host* host, const std::vector<double>& speed_per_pstate) : Cpu(host, speed_per_pstate){};
+  using kernel::resource::Cpu::Cpu;
   CpuL07(const CpuL07&) = delete;
   CpuL07& operator=(const CpuL07&) = delete;
 
index 9e43b7b..1286111 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char** argv)
   xbt_assert(argc > 1, "Usage: %s platform.xml\n", argv[0]);
   parse_platform_file(argv[1]);
 
-  sg_netzone_t as_zone                               = sg_zone_get_by_name("AS0");
+  const_sg_netzone_t as_zone                         = sg_zone_get_by_name("AS0");
   simgrid::kernel::resource::NetworkModel* net_model = as_zone->get_impl()->get_network_model();
   simgrid::kernel::resource::CpuModel* cpu_model_pm  = as_zone->get_impl()->get_cpu_pm_model();
 
index 27a6e78..5288350 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char** argv)
   hostB->pimpl_cpu->execution_start(1000.0);
   hostB->pimpl_cpu->sleep(7.32);
 
-  sg_netzone_t as_zone                               = sg_zone_get_by_name("AS0");
+  const_sg_netzone_t as_zone                         = sg_zone_get_by_name("AS0");
   simgrid::kernel::resource::NetworkModel* net_model = as_zone->get_impl()->get_network_model();
   net_model->communicate(hostA, hostB, 150.0, -1.0);