X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0cf55eb21f1c33798b700bc0608d25ed45f52e7b..98f86232eb9857c8c31067d5db378a6ad417165c:/src/simdag/sd_task.c?ds=sidebyside diff --git a/src/simdag/sd_task.c b/src/simdag/sd_task.c index dc05a2244e..5d13f2af3a 100644 --- a/src/simdag/sd_task.c +++ b/src/simdag/sd_task.c @@ -14,6 +14,7 @@ static void __SD_task_destroy_scheduling_data(SD_task_t task); * * \param name the name of the task (can be \c NULL) * \param data the user data you want to associate with the task (can be \c NULL) + * \param amount amount of the task * \return the new task * \see SD_task_destroy() */ @@ -250,6 +251,9 @@ void SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task if (name != NULL) dependency->name = xbt_strdup(name); + else + dependency->name = NULL; + dependency->data = data; dependency->src = src; dependency->dst = dst; @@ -421,8 +425,8 @@ double SD_task_get_execution_time(SD_task_t task, time = SD_workstation_get_computation_time(workstation_list[i], computation_amount[i]); for (j = 0; j < workstation_nb; j++) { - time += SD_workstation_route_get_communication_time(workstation_list[i], workstation_list[j], - communication_amount[i * 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) { @@ -536,6 +540,8 @@ surf_action_t __SD_task_run(SD_task_t task) { task->amount, task->rate); + DEBUG1("surf_action = %p", surf_action); + __SD_task_destroy_scheduling_data(task); /* now the scheduling data are not useful anymore */ __SD_task_set_state(task, SD_RUNNING); @@ -581,6 +587,9 @@ void SD_task_destroy(SD_task_t task) { if (task->name != NULL) xbt_free(task->name); + if (task->surf_action != NULL) + surf_workstation_resource->common_public->action_free(task->surf_action); + xbt_dynar_free(&task->tasks_before); xbt_dynar_free(&task->tasks_after); xbt_free(task);