Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / surf / ptask_L07.cpp
index eafd6d2..ac76b6c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -36,7 +36,7 @@ void surf_host_model_init_ptask_L07()
   XBT_CINFO(xbt_cfg, "Switching to the L07 model to handle parallel tasks.");
   xbt_assert(cfg_ptask_solver != "maxmin", "Invalid configuration. Cannot use maxmin solver with parallel tasks.");
 
-  auto* system    = simgrid::kernel::lmm::System::build(cfg_ptask_solver, true /* selective update */);
+  auto* system    = simgrid::kernel::lmm::System::build(cfg_ptask_solver.get(), true /* selective update */);
   auto host_model = std::make_shared<simgrid::kernel::resource::HostL07Model>("Host_Ptask", system);
   auto* engine    = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(host_model);
@@ -57,6 +57,8 @@ HostL07Model::HostL07Model(const std::string& name, lmm::System* sys) : HostMode
   auto cpu_model = std::make_shared<CpuL07Model>("Cpu_Ptask", this, sys);
   engine->add_model(cpu_model);
   engine->get_netzone_root()->set_cpu_pm_model(cpu_model);
+
+  surf_disk_model_init_S19();
 }
 
 CpuL07Model::CpuL07Model(const std::string& name, HostL07Model* hmodel, lmm::System* sys)
@@ -205,7 +207,7 @@ L07Action::L07Action(Model* model, const std::vector<s4u::Host*>& host_list, con
    * communication either */
   for (size_t i = 0; i < host_nb; i++) {
     model->get_maxmin_system()->expand(host_list[i]->get_cpu()->get_constraint(), get_variable(),
-                                       (flops_amount == nullptr ? 0.0 : flops_amount[i]));
+                                       (flops_amount == nullptr ? 0.0 : flops_amount[i]), true);
   }
 
   if (bytes_amount != nullptr) {
@@ -228,7 +230,7 @@ L07Action::L07Action(Model* model, const std::vector<s4u::Host*>& host_list, con
   update_bound();
 }
 
-Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
+Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate, bool /* streamed */)
 {
   std::vector<s4u::Host*> host_list = {src, dst};
   const auto* flops_amount          = new double[2]();
@@ -295,7 +297,7 @@ void CpuL07::on_speed_change()
   get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), get_core_count() * speed_.peak * speed_.scale);
 
   while (const auto* var = get_constraint()->get_variable(&elem)) {
-    auto* action = static_cast<L07Action*>(var->get_id());
+    const auto* action = static_cast<L07Action*>(var->get_id());
     action->update_bound();
   }
 
@@ -368,7 +370,7 @@ void LinkL07::set_latency(double value)
 
   latency_.peak = value;
   while (const auto* var = get_constraint()->get_variable(&elem)) {
-    auto* action = static_cast<L07Action*>(var->get_id());
+    const auto* action = static_cast<L07Action*>(var->get_id());
     action->update_bound();
   }
 }
@@ -386,7 +388,7 @@ L07Action::~L07Action()
   }
 }
 
-double L07Action::calculate_network_bound()
+double L07Action::calculate_network_bound() const
 {
   double lat_current = 0.0;
   double lat_bound   = std::numeric_limits<double>::max();
@@ -414,7 +416,7 @@ double L07Action::calculate_network_bound()
   return lat_bound;
 }
 
-double L07Action::calculate_cpu_bound()
+double L07Action::calculate_cpu_bound() const
 {
   double cpu_bound = std::numeric_limits<double>::max();
 
@@ -431,7 +433,7 @@ double L07Action::calculate_cpu_bound()
   return cpu_bound;
 }
 
-void L07Action::update_bound()
+void L07Action::update_bound() const
 {
   double bound = std::min(calculate_network_bound(), calculate_cpu_bound());