get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), get_core_count() * speed_.peak * speed_.scale);
while (const auto* var = get_constraint()->get_variable(&elem)) {
- auto* action = static_cast<L07Action*>(var->get_id());
+ const auto* action = static_cast<L07Action*>(var->get_id());
action->update_bound();
}
latency_.peak = value;
while (const auto* var = get_constraint()->get_variable(&elem)) {
- auto* action = static_cast<L07Action*>(var->get_id());
+ const auto* action = static_cast<L07Action*>(var->get_id());
action->update_bound();
}
}
}
}
-double L07Action::calculate_network_bound()
+double L07Action::calculate_network_bound() const
{
double lat_current = 0.0;
double lat_bound = std::numeric_limits<double>::max();
return lat_bound;
}
-double L07Action::calculate_cpu_bound()
+double L07Action::calculate_cpu_bound() const
{
double cpu_bound = std::numeric_limits<double>::max();
return cpu_bound;
}
-void L07Action::update_bound()
+void L07Action::update_bound() const
{
double bound = std::min(calculate_network_bound(), calculate_cpu_bound());
* The task is bounded by the slowest CPU running the ptask, considering the current pstate of each CPU.
* Return MAX_DOUBLE if ptask has no computation.
*/
- double calculate_cpu_bound();
+ double calculate_cpu_bound() const;
/**
* @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();
+ double calculate_network_bound() const;
public:
L07Action() = delete;
L07Action& operator=(const L07Action&) = delete;
~L07Action() override;
- void update_bound();
+ void update_bound() const;
double get_latency() const { return latency_; }
void set_latency(double latency) { latency_ = latency; }
void update_latency(double delta, double precision) { double_update(&latency_, delta, precision); }