X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8b853cf697928f829717bb60bd9c1cadaf2beb8e..603a2971cfa9ec8a4fd4493b74c5680956828423:/src/surf/ptask_L07.cpp diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index e29624146c..384656cf45 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -131,9 +131,9 @@ void HostL07Model::update_actions_state(double /*now*/, double delta) } } -kernel::resource::Action* HostL07Model::execute_parallel(const std::vector& host_list, - const double* flops_amount, const double* bytes_amount, - double rate) +kernel::resource::CpuAction* HostL07Model::execute_parallel(const std::vector& host_list, + const double* flops_amount, const double* bytes_amount, + double rate) { return new L07Action(this, host_list, flops_amount, bytes_amount, rate); } @@ -218,7 +218,7 @@ kernel::resource::Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host return res; } -Cpu* CpuL07Model::create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) +kernel::resource::Cpu* CpuL07Model::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) { return new CpuL07(this, host, speed_per_pstate, core); } @@ -254,24 +254,24 @@ LinkL07::LinkL07(NetworkL07Model* model, const std::string& name, double bandwid s4u::Link::on_creation(this->piface_); } -kernel::resource::Action* CpuL07::execution_start(double size) +kernel::resource::CpuAction* CpuL07::execution_start(double size) { std::vector host_list = {get_host()}; double* flops_amount = new double[host_list.size()](); flops_amount[0] = size; - kernel::resource::Action* res = + kernel::resource::CpuAction* res = static_cast(get_model())->hostModel_->execute_parallel(host_list, flops_amount, nullptr, -1); static_cast(res)->free_arrays_ = true; return res; } -kernel::resource::Action* CpuL07::sleep(double duration) +kernel::resource::CpuAction* CpuL07::sleep(double duration) { L07Action *action = static_cast(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; @@ -405,7 +405,7 @@ void L07Action::updateBound() } 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