Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add FAT_PIPE
[simgrid.git] / src / msg / task.c
index ff8b008..1fe3975 100644 (file)
@@ -64,7 +64,6 @@ m_task_t MSG_task_create(const char *name, double compute_duration,
   simdata->using = 1;
   simdata->sender = NULL;
 
-
   return task;
 }
 
@@ -132,7 +131,7 @@ MSG_error_t MSG_task_destroy(m_task_t task)
   if(action) action->resource_type->common_public->action_free(action);
   action = task->simdata->comm;
   if(action) action->resource_type->common_public->action_free(action);
-
+  if(task->simdata->host_list) xbt_free(task->simdata->host_list);
 
   free(task->simdata);
   free(task);
@@ -140,6 +139,32 @@ MSG_error_t MSG_task_destroy(m_task_t task)
   return MSG_OK;
 }
 
+/** \ingroup m_task_management
+ * \brief Returns the computation amount needed to process a task #m_task_t.
+ *
+ */
+double MSG_task_get_compute_duration(m_task_t task)
+{
+  simdata_task_t simdata = NULL;
+
+  xbt_assert0((task != NULL) && (task->simdata != NULL), "Invalid parameter");
+
+  return task->simdata->computation_amount;
+}
+
+/** \ingroup m_task_management
+ * \brief Returns the size of the data attached to a task #m_task_t.
+ *
+ */
+double MSG_task_get_data_size(m_task_t task)
+{
+  simdata_task_t simdata = NULL;
+
+  xbt_assert0((task != NULL) && (task->simdata != NULL), "Invalid parameter");
+
+  return task->simdata->message_size;
+}
+
 /* static MSG_error_t __MSG_task_check(m_task_t task) */
 /* { */
 /*   simdata_task_t simdata = NULL; */