- /* Copy the elements of the task into the action */
- int host_nb = task->allocation->size();
- sg_host_t *hosts = xbt_new(sg_host_t, host_nb);
- int i =0;
- for (auto host: *task->allocation){
- hosts[i] = host;
- i++;
- }
-
- double *flops_amount = xbt_new0(double, host_nb);
- double *bytes_amount = xbt_new0(double, host_nb * host_nb);
-
- if(task->flops_amount)
- memcpy(flops_amount, task->flops_amount, sizeof(double) * host_nb);
- if(task->bytes_amount)
- memcpy(bytes_amount, task->bytes_amount, sizeof(double) * host_nb * host_nb);
-
- task->surf_action = surf_host_model->executeParallelTask(host_nb, hosts, flops_amount, bytes_amount, task->rate);
+ /* Beware! The scheduling data are now used by the surf action directly! no copy was done */
+ task->surf_action =
+ surf_host_model->execute_parallel(*task->allocation, task->flops_amount, task->bytes_amount, task->rate);