Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use references for parameters of type std::vector.
[simgrid.git] / src / surf / ptask_L07.cpp
index f49ad5e..9a4715d 100644 (file)
@@ -131,14 +131,14 @@ void HostL07Model::update_actions_state(double /*now*/, double delta)
   }
 }
 
-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)
 {
@@ -258,7 +258,7 @@ kernel::resource::Action* CpuL07::execution_start(double size)
 {
   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 =