- model->get_maxmin_system()->update_variable_weight(get_variable(), 0.0);
-
- if (flops_amount != nullptr)
- for (int i = 0; i < host_nb; i++)
- model->get_maxmin_system()->expand(host_list[i]->pimpl_cpu->get_constraint(), get_variable(), flops_amount[i]);
+ model->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0);
+
+ /* Expand it for the CPUs even if there is nothing to compute, to make sure that it gets expended even if there is no
+ * communication either */
+ double bound = std::numeric_limits<double>::max();
+ for (size_t i = 0; i < host_list.size(); i++) {
+ model->get_maxmin_system()->expand(host_list[i]->pimpl_cpu->get_constraint(), get_variable(),
+ (flops_amount == nullptr ? 0.0 : flops_amount[i]));
+ if (flops_amount && flops_amount[i] > 0)
+ bound = std::min(bound, host_list[i]->pimpl_cpu->get_speed(1.0) * host_list[i]->pimpl_cpu->get_speed_ratio() /
+ flops_amount[i]);
+ }
+ if (bound < std::numeric_limits<double>::max())
+ model->get_maxmin_system()->update_variable_bound(get_variable(), bound);