Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid unnecessary copy of parameters for parallel_execute.
[simgrid.git] / src / surf / ptask_L07.cpp
index 674c35d..5b6be89 100644 (file)
@@ -121,7 +121,7 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
       while (cnst != nullptr) {
         i++;
         void* constraint_id = cnst->get_id();
-        if (static_cast<simgrid::kernel::resource::Resource*>(constraint_id)->is_off()) {
+        if (not static_cast<simgrid::kernel::resource::Resource*>(constraint_id)->is_on()) {
           XBT_DEBUG("Action (%p) Failed!!", &action);
           action.finish(kernel::resource::Action::State::FAILED);
           break;
@@ -132,14 +132,15 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
   }
 }
 
-kernel::resource::Action* HostL07Model::execute_parallel(size_t host_nb, sg_host_t* host_list, double* flops_amount,
-                                                         double* bytes_amount, double rate)
+kernel::resource::Action* HostL07Model::execute_parallel(size_t host_nb, s4u::Host* const* host_list,
+                                                         const double* flops_amount, const double* bytes_amount,
+                                                         double rate)
 {
   return new L07Action(this, host_nb, host_list, flops_amount, bytes_amount, rate);
 }
 
-L07Action::L07Action(kernel::resource::Model* model, size_t host_nb, sg_host_t* host_list, double* flops_amount,
-                     double* bytes_amount, double rate)
+L07Action::L07Action(kernel::resource::Model* model, size_t host_nb, s4u::Host* const* host_list,
+                     const double* flops_amount, const double* bytes_amount, double rate)
     : CpuAction(model, 1, 0), computationAmount_(flops_amount), communicationAmount_(bytes_amount), rate_(rate)
 {
   size_t link_nb      = 0;
@@ -314,7 +315,7 @@ bool LinkL07::is_used()
   return get_model()->get_maxmin_system()->constraint_used(get_constraint());
 }
 
-void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
+void CpuL07::apply_event(kernel::profile::Event* triggered, double value)
 {
   XBT_DEBUG("Updating cpu %s (%p) with value %g", get_cname(), this, value);
   if (triggered == speed_.event) {
@@ -324,7 +325,7 @@ void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
 
   } else if (triggered == state_event_) {
     if (value > 0) {
-      if (is_off()) {
+      if (not is_on()) {
         XBT_VERB("Restart processes on host %s", get_host()->get_cname());
         get_host()->turn_on();
       }
@@ -337,7 +338,7 @@ void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
   }
 }
 
-void LinkL07::apply_event(tmgr_trace_event_t triggered, double value)
+void LinkL07::apply_event(kernel::profile::Event* triggered, double value)
 {
   XBT_DEBUG("Updating link %s (%p) with value=%f", get_cname(), this, value);
   if (triggered == bandwidth_.event) {