}
}
-kernel::resource::Action* HostL07Model::execute_parallel(const std::vector<s4u::Host*> host_list,
+kernel::resource::Action* HostL07Model::execute_parallel(const std::vector<s4u::Host*>& host_list,
const double* flops_amount, const double* bytes_amount,
double rate)
{
return new L07Action(this, host_list, flops_amount, bytes_amount, rate);
}
-L07Action::L07Action(kernel::resource::Model* model, const std::vector<s4u::Host*> host_list,
+L07Action::L07Action(kernel::resource::Model* model, const std::vector<s4u::Host*>& host_list,
const double* flops_amount, const double* bytes_amount, double rate)
: CpuAction(model, 1, 0), computationAmount_(flops_amount), communicationAmount_(bytes_amount), rate_(rate)
{
return res;
}
-Cpu* CpuL07Model::create_cpu(simgrid::s4u::Host* host, std::vector<double>* speed_per_pstate, int core)
+kernel::resource::Cpu* CpuL07Model::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
{
return new CpuL07(this, host, speed_per_pstate, core);
}
* Resource *
************/
-CpuL07::CpuL07(CpuL07Model* model, simgrid::s4u::Host* host, std::vector<double>* speed_per_pstate, int core)
- : Cpu(model, host, model->get_maxmin_system()->constraint_new(this, speed_per_pstate->front()), speed_per_pstate,
+CpuL07::CpuL07(CpuL07Model* model, simgrid::s4u::Host* host, const std::vector<double>& speed_per_pstate, int core)
+ : Cpu(model, host, model->get_maxmin_system()->constraint_new(this, speed_per_pstate.front()), speed_per_pstate,
core)
{
}
{
std::vector<s4u::Host*> host_list = {get_host()};
- double* flops_amount = new double[1]();
+ double* flops_amount = new double[host_list.size()]();
flops_amount[0] = size;
kernel::resource::Action* res =
{
L07Action *action = static_cast<L07Action*>(execution_start(1.0));
action->set_max_duration(duration);
- action->suspended_ = kernel::resource::Action::SuspendStates::sleeping;
+ action->set_suspend_state(kernel::resource::Action::SuspendStates::SLEEPING);
get_model()->get_maxmin_system()->update_variable_weight(action->get_variable(), 0.0);
return action;
}
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) && (suspended_ == Action::SuspendStates::not_suspended)) {
+ if ((latency_ <= 0.0) && is_running()) {
if (rate_ < 0)
get_model()->get_maxmin_system()->update_variable_bound(get_variable(), lat_bound);
else