From: Fred Suter Date: Tue, 8 Nov 2022 19:24:03 +0000 (-0500) Subject: further simplification/cleanups X-Git-Tag: v3.34~685 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2cfea93ddbd94debacaf5d7f8adb8e487aa2bb7a further simplification/cleanups --- diff --git a/src/surf/sio_S22.cpp b/src/surf/sio_S22.cpp index 3d5aa3b95d..1e09262aa6 100644 --- a/src/surf/sio_S22.cpp +++ b/src/surf/sio_S22.cpp @@ -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 @@ -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("network/crosstraffic", true); - auto* system = simgrid::kernel::lmm::System::build(cfg_sio_solver.get(), true /* selective update */); - auto host_model = std::make_shared("Host_Sio", system); + auto host_model = std::make_shared("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); diff --git a/src/surf/sio_S22.hpp b/src/surf/sio_S22.hpp index fe53781ee9..d37d74098d 100644 --- a/src/surf/sio_S22.hpp +++ b/src/surf/sio_S22.hpp @@ -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);