Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Specialize return types.
[simgrid.git] / src / surf / ptask_L07.cpp
index e296241..384656c 100644 (file)
@@ -131,9 +131,9 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
   }
 }
 
-kernel::resource::Action* HostL07Model::execute_parallel(const std::vector<s4u::Host*>& host_list,
-                                                         const double* flops_amount, const double* bytes_amount,
-                                                         double rate)
+kernel::resource::CpuAction* 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);
 }
@@ -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<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);
 }
@@ -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<s4u::Host*> 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<CpuL07Model*>(get_model())->hostModel_->execute_parallel(host_list, flops_amount, nullptr, -1);
   static_cast<L07Action*>(res)->free_arrays_ = true;
   return res;
 }
 
-kernel::resource::Action* CpuL07::sleep(double duration)
+kernel::resource::CpuAction* CpuL07::sleep(double duration)
 {
   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;
@@ -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