-double HostCLM03Model::shareResources(double now){
- adjustWeightOfDummyCpuActions();
-
- double min_by_cpu = p_cpuModel->shareResources(now);
- double min_by_net = (strcmp(surf_network_model->getName(), "network NS3")) ? surf_network_model->shareResources(now) : -1;
- double min_by_sto = -1;
- if (p_cpuModel == surf_cpu_model_pm)
- min_by_sto = surf_storage_model->shareResources(now);
-
- XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
- this, surf_cpu_model_pm->getName(), min_by_cpu,
- surf_network_model->getName(), min_by_net,
- surf_storage_model->getName(), min_by_sto);
-
- double res = max(max(min_by_cpu, min_by_net), min_by_sto);
- if (min_by_cpu >= 0.0 && min_by_cpu < res)
- res = min_by_cpu;
- if (min_by_net >= 0.0 && min_by_net < res)
- res = min_by_net;
- if (min_by_sto >= 0.0 && min_by_sto < res)
- res = min_by_sto;
- return res;
-}
+Action* HostCLM03Model::io_stream(s4u::Host* src_host, DiskImpl* src_disk, s4u::Host* dst_host, DiskImpl* dst_disk,
+ double size)
+{
+ auto net_model = src_host->get_englobing_zone()->get_network_model();
+ auto system = net_model->get_maxmin_system();
+ auto* action = net_model->communicate(src_host, dst_host, size, -1, true);
+
+ size_t nb_disks = 0;
+ if (src_disk != nullptr)
+ nb_disks++;
+ if (dst_disk != nullptr)
+ nb_disks++;
+
+ // We don't want to apply the network model bandwidth factor to the I/O constraints
+ double bw_factor = net_model->get_bandwidth_factor();
+ if (src_disk != nullptr){
+ //FIXME: if the stream starts from a disk, we might not want to pay the network latency
+ system->expand(src_disk->get_constraint(), action->get_variable(), bw_factor);
+ system->expand(src_disk->get_read_constraint(), action->get_variable(), bw_factor);
+ }
+ if (dst_disk != nullptr){
+ system->expand(dst_disk->get_constraint(), action->get_variable(), bw_factor);
+ system->expand(dst_disk->get_write_constraint(), action->get_variable(), bw_factor);
+ }