Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill the useless 'rate' argument of SD_task_get_execution_time()
[simgrid.git] / src / simdag / sd_task.c
index 57a11a3..bed2939 100644 (file)
@@ -240,10 +240,10 @@ SD_workstation_t* SD_task_get_workstation_list(SD_task_t task)
 }
 
 /**
- * \brief Returns the total amount of a task
+ * \brief Returns the total amount of work contained in a task
  *
  * \param task a task
- * \return the total amount of this task
+ * \return the total amount of work (computation or data transfer) for this task
  * \see SD_task_get_remaining_amount()
  */
 double SD_task_get_amount(SD_task_t task)
@@ -254,10 +254,10 @@ double SD_task_get_amount(SD_task_t task)
 }
 
 /**
- * \brief Returns the remaining amount of a task
+ * \brief Returns the remaining amount work to do till the completion of a task
  *
  * \param task a task
- * \return the remaining amount of this task
+ * \return the remaining amount of work (computation or data transfer) of this task
  * \see SD_task_get_amount()
  */
 double SD_task_get_remaining_amount(SD_task_t task)
@@ -332,6 +332,8 @@ void SD_task_dotty(SD_task_t task,void* out) {
     case SD_TASK_COMP_SEQ:
       fprintf(out,", shape=circle");
       break;
+    default:
+      xbt_die("Unknown task type!");
   }
   fprintf(out,"];\n");
   xbt_dynar_foreach(task->tasks_before,counter,dependency) {
@@ -631,15 +633,13 @@ void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state)
  * \param workstation_list the workstations on which the task would be executed
  * \param computation_amount computation amount for each workstation
  * \param communication_amount communication amount between each pair of workstations
- * \param rate task execution speed rate
  * \see SD_schedule()
  */
 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)
+                                  const double *communication_amount)
 {
   double time, max_time = 0.0;
   int i, j;
@@ -668,7 +668,7 @@ double SD_task_get_execution_time(SD_task_t task,
       max_time = time;
     }
   }
-  return max_time * SD_task_get_amount(task);
+  return max_time;
 }
 static inline void SD_task_do_schedule(SD_task_t task) {
   SD_CHECK_INIT_DONE();
@@ -772,6 +772,7 @@ static void __SD_task_destroy_scheduling_data(SD_task_t task)
 
   xbt_free(task->computation_amount);
   xbt_free(task->communication_amount);
+  task->computation_amount = task->communication_amount = NULL;
 }
 
 /* Runs a task. This function is directly called by __SD_task_try_to_run if the task
@@ -1163,6 +1164,12 @@ void SD_task_destroy(SD_task_t task)
   if (task->workstation_list != NULL)
     xbt_free(task->workstation_list);
 
+  if (task->communication_amount)
+    xbt_free(task->communication_amount);
+
+  if (task->computation_amount)
+    xbt_free(task->computation_amount);
+
   xbt_dynar_free(&task->tasks_before);
   xbt_dynar_free(&task->tasks_after);
   xbt_free(task);