#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>
{
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);
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)
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)
{
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);
***********/
class XBT_PRIVATE HostS22Model;
-
-class XBT_PRIVATE DiskS22;
-class XBT_PRIVATE LinkS22;
-
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;
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);