Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Taking into account last SURF modifications (suspend, resume and is_suspended moved...
[simgrid.git] / src / msg / task.c
index 530be8b..007160c 100644 (file)
@@ -48,9 +48,11 @@ m_task_t MSG_task_create(const char *name, long double compute_duration,
   simdata->sleeping = xbt_dynar_new(sizeof(m_process_t),NULL);
   simdata->computation_amount = compute_duration;
   simdata->message_size = message_size;
+  simdata->rate = -1.0;
   simdata->using = 1;
   simdata->sender = NULL;
 
+
   return task;
 }
 
@@ -67,6 +69,18 @@ void *MSG_task_get_data(m_task_t task)
   return (task->data);
 }
 
+/** \ingroup m_task_management
+ * \brief Return the sender of a #m_task_t.
+ *
+ * This functions returns the #m_process_t which sent this task
+ */
+m_process_t MSG_task_get_sender(m_task_t task)
+{
+   xbt_assert0(task, "Invalid parameters");
+   return ((simdata_task_t) task->simdata)->sender;
+}
+
+
 /** \ingroup m_task_management
  * \brief Destroy a #m_task_t.
  *