X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b3d18155a991509df0050df72c7531ffbcae7efc..1d788f0aa070c370acfaa33dee4004958c48c145:/src/msg/task.c diff --git a/src/msg/task.c b/src/msg/task.c index 530be8bd15..80a7c72692 100644 --- a/src/msg/task.c +++ b/src/msg/task.c @@ -13,6 +13,18 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(task, msg, static char sprint_buffer[64]; +/** \defgroup m_task_management Managing functions of Tasks + * \brief This section describes the task structure of MSG + * (#m_task_t) and the functions for managing it. + * + * Since most scheduling algorithms rely on a concept of task + * that can be either computed locally or + * transferred on another processor, it seems to be the + * right level of abstraction for our purposes. A task + * may then be defined by a computing amount, a + * message size and some private data. + */ + /********************************* Task **************************************/ /** \ingroup m_task_management * \brief Creates a new #m_task_t. @@ -48,9 +60,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 +81,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. *