-static void __SD_task_destroy_scheduling_data(SD_task_t task) {
- xbt_free(task->workstation_list);
- xbt_free(task->computation_amount);
- xbt_free(task->communication_amount);
+double SD_task_get_execution_time(SD_task_t task,
+ int workstation_nb,
+ const SD_workstation_t *workstation_list,
+ const double *computation_amount,
+ const double *communication_amount,
+ double rate) {
+ /* the task execution time is the maximum execution time of the parallel tasks */
+ double time, max_time = 0.0;
+ int i, j;
+ for (i = 0; i < workstation_nb; i++) {
+ time = SD_workstation_get_computation_time(workstation_list[i], computation_amount[i]);
+
+ for (j = 0; j < workstation_nb; j++) {
+ time += SD_route_get_communication_time(workstation_list[i], workstation_list[j],
+ communication_amount[i * workstation_nb + j]);
+ }
+
+ if (time > max_time) {
+ max_time = time;
+ }
+ }
+ return max_time * SD_task_get_amount(task);