- double lat_bound = kernel::resource::NetworkModel::cfg_tcp_gamma / (2.0 * lat_current);
- XBT_DEBUG("action (%p) : lat_bound = %g", this, lat_bound);
- if ((latency_ <= 0.0) && is_running()) {
+ if (lat_current > 0) {
+ lat_bound = NetworkModel::cfg_tcp_gamma / (2.0 * lat_current);
+ }
+ return lat_bound;
+}
+
+double L07Action::calculateCpuBound()
+{
+ double cpu_bound = std::numeric_limits<double>::max();
+
+ if (computationAmount_ == nullptr) {
+ return cpu_bound;
+ }
+
+ for (size_t i = 0; i < hostList_.size(); i++) {
+ if (computationAmount_[i] > 0) {
+ cpu_bound = std::min(cpu_bound, hostList_[i]->get_cpu()->get_speed(1.0) *
+ hostList_[i]->get_cpu()->get_speed_ratio() / computationAmount_[i]);
+ }
+ }
+ return cpu_bound;
+}
+
+void L07Action::updateBound()
+{
+ double bound = std::min(calculateNetworkBound(), calculateCpuBound());
+
+ XBT_DEBUG("action (%p) : bound = %g", this, bound);
+
+ /* latency has been paid (or no latency), we can set the appropriate bound for multicore or network limit */
+ if ((bound < std::numeric_limits<double>::max()) && (latency_ <= 0.0)) {