}
S22Action::S22Action(Model* model, s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk, double size)
- : DiskAction(model, 1.0, false)
+ : DiskAction(model, 1, false)
, src_host_(src_host)
, src_disk_(src_disk)
, dst_host_(dst_host)
link_nb = affected_links.size();
}
- XBT_DEBUG("Creating a stream io (%p) with %zu hosts and %zu unique links.", this, disk_nb, link_nb);
+ XBT_DEBUG("Creating a stream io (%p) with %zu disk(s) and %zu unique link(s).", this, disk_nb, link_nb);
latency_ = latency;
set_variable(model->get_maxmin_system()->variable_new(this, 1.0, -1.0, disk_nb + link_nb));
update_bound();
}
-S22Action* HostS22Model::io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk,
+DiskAction* HostS22Model::io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk,
double size)
{
return new S22Action(this, src_host, src_disk, dst_host, dst_disk, size);
************/
DiskAction* DiskS22::io_start(sg_size_t size, s4u::Io::OpType type)
{
- return static_cast<S22Action*>(io_start(size, type));
+ DiskAction* res;
+ switch (type) {
+ case s4u::Io::OpType::READ:
+ res = static_cast<DiskS22Model*>(get_model())->hostModel_->io_stream(get_host(), this, get_host(), nullptr, size);
+ break;
+ case s4u::Io::OpType::WRITE:
+ res = static_cast<DiskS22Model*>(get_model())->hostModel_->io_stream(get_host(), nullptr, get_host(), this, size);
+ break;
+ default:
+ THROW_UNIMPLEMENTED;
+ }
+
+ return res;
}
void DiskS22::apply_event(kernel::profile::Event* triggered, double value)
/**********
* Action *
**********/
+
double S22Action::calculate_io_read_bound() const
{
double io_read_bound = std::numeric_limits<double>::max();
XBT_DEBUG("action (%p) : bound = %g", this, bound);
/* latency has been paid (or no latency), we can set the appropriate bound for network limit */
- if ((bound < std::numeric_limits<double>::max()) && (latency_ <= 0.0)) {
- if (rate_ < 0)
- get_model()->get_maxmin_system()->update_variable_bound(get_variable(), bound);
- else
- get_model()->get_maxmin_system()->update_variable_bound(get_variable(), std::min(rate_, bound));
- }
-}
+ if ((bound < std::numeric_limits<double>::max()) && (latency_ <= 0.0))
+ get_model()->get_maxmin_system()->update_variable_bound(get_variable(), bound);
+ }
} // namespace simgrid::kernel::resource
Action* execute_thread(const s4u::Host* host, double flops_amount, int thread_count) override { return nullptr; }
CpuAction* execute_parallel(const std::vector<s4u::Host*>& host_list, const double* flops_amount,
const double* bytes_amount, double rate) override { return nullptr; }
- S22Action* io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk, double size);
+ DiskAction* io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk, double size);
};
class DiskS22Model : public DiskModel {