Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further simplification/cleanups
authorFred Suter <suterf@ornl.gov>
Tue, 8 Nov 2022 19:24:03 +0000 (14:24 -0500)
committerFred Suter <suterf@ornl.gov>
Wed, 9 Nov 2022 22:53:48 +0000 (17:53 -0500)
src/surf/sio_S22.cpp
src/surf/sio_S22.hpp

index 3d5aa3b..1e09262 100644 (file)
@@ -9,10 +9,6 @@
 
 #include "simgrid/config.h"
 #include "src/kernel/EngineImpl.hpp"
-#if SIMGRID_HAVE_EIGEN3
-#include "src/kernel/lmm/bmf.hpp"
-#endif
-#include "src/kernel/resource/profile/Event.hpp"
 #include "src/surf/sio_S22.hpp"
 
 #include <unordered_set>
@@ -35,8 +31,11 @@ void surf_host_model_init_sio_S22()
 {
   XBT_CINFO(xbt_cfg, "Switching to the S22 model to handle streaming I/Os.");
   simgrid::config::set_default<bool>("network/crosstraffic", true);
-  auto* system    = simgrid::kernel::lmm::System::build(cfg_sio_solver.get(), true /* selective update */);
-  auto host_model = std::make_shared<simgrid::kernel::resource::HostS22Model>("Host_Sio", system);
+  auto host_model = std::make_shared<simgrid::kernel::resource::HostS22Model>("Host_Sio");
+  surf_network_model_init_LegrandVelho();
+  surf_cpu_model_init_Cas01();
+  surf_disk_model_init_S19();
+
   auto* engine    = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(host_model);
   engine->get_netzone_root()->set_host_model(host_model);
@@ -44,12 +43,9 @@ void surf_host_model_init_sio_S22()
 
 namespace simgrid::kernel::resource {
 
-HostS22Model::HostS22Model(const std::string& name, lmm::System* sys) : HostModel(name)
+HostS22Model::HostS22Model(const std::string& name) : HostModel(name)
 {
-  set_maxmin_system(sys);
-  surf_network_model_init_LegrandVelho();
-  surf_cpu_model_init_Cas01();
-  surf_disk_model_init_S19();
+  set_maxmin_system(lmm::System::build(cfg_sio_solver.get(), true /* selective update */));
 }
 
 double HostS22Model::next_occurring_event(double now)
@@ -90,34 +86,14 @@ void HostS22Model::update_actions_state(double /*now*/, double delta)
 
     XBT_DEBUG("Action (%p) : remains (%g).", &action, action.get_remains());
 
-    /* In the next if cascade, the action can be finished either because:
-     *  - The amount of remaining work reached 0
-     *  - The max duration was reached
-     * If it's not done, it may have failed.
-     */
-
     if (((action.get_remains() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
         ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
       action.finish(Action::State::FINISHED);
       continue;
     }
-
-    /* Need to check that none of the model has failed */
-    int i                               = 0;
-    const lmm::Constraint* cnst         = action.get_variable()->get_constraint(i);
-    while (cnst != nullptr) {
-      i++;
-      if (not cnst->get_id()->is_on()) {
-        XBT_DEBUG("Action (%p) Failed!!", &action);
-        action.finish(Action::State::FAILED);
-        break;
-      }
-      cnst = action.get_variable()->get_constraint(i);
-    }
   }
 }
 
-
 DiskAction* HostS22Model::io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk,
                                    double size)
 {
@@ -178,7 +154,7 @@ S22Action::S22Action(Model* model, s4u::Host* src_host, DiskImpl* src_disk, s4u:
 
   XBT_DEBUG("Creating a stream io (%p) with %zu disk(s) and %zu unique link(s).", this, disk_nb, link_nb);
 
-  set_variable(model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3 * disk_nb + link_nb));
+  set_variable(model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 2 * disk_nb + link_nb));
 
   if (latency_ > 0)
     model->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
index fe53781..d37d740 100644 (file)
@@ -18,10 +18,6 @@ namespace simgrid::kernel::resource {
  ***********/
 
 class XBT_PRIVATE HostS22Model;
-
-class XBT_PRIVATE DiskS22;
-class XBT_PRIVATE LinkS22;
-
 class XBT_PRIVATE S22Action;
 
 /*********
@@ -29,7 +25,7 @@ class XBT_PRIVATE S22Action;
  *********/
 class HostS22Model : public HostModel {
 public:
-  HostS22Model(const std::string& name, lmm::System* sys);
+  HostS22Model(const std::string& name);
   HostS22Model(const HostS22Model&) = delete;
   HostS22Model& operator=(const HostS22Model&) = delete;
 
@@ -53,17 +49,8 @@ class S22Action : public DiskAction {
   const DiskImpl* dst_disk_;
 
   const double size_;
-
   double latency_ = 0;
 
-  /**
-   * @brief Calculate the network bound for the parallel task
-   *
-   * The network bound depends on the largest latency between the communication in the ptask.
-   * Return MAX_DOUBLE if latency is 0 (or ptask doesn't have any communication)
-   */
-  double calculate_network_bound() const;
-
 public:
   S22Action() = delete;
   S22Action(Model* model, s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk, double size);