Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Implemented the MSG_task_get_source() function. (See ChangeLog)
authorcasanova <casanova@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Aug 2005 20:48:40 +0000 (20:48 +0000)
committercasanova <casanova@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 30 Aug 2005 20:48:40 +0000 (20:48 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1676 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/msg/msg.h
include/xbt/fifo.h
src/msg/gos.c
src/msg/private.h
src/msg/task.c

index cf0009b..33f4ce0 100644 (file)
@@ -83,6 +83,7 @@ m_task_t MSG_parallel_task_create(const char *name,
                                  void *data);
 void *MSG_task_get_data(m_task_t task);
 m_process_t MSG_task_get_sender(m_task_t task);
                                  void *data);
 void *MSG_task_get_data(m_task_t task);
 m_process_t MSG_task_get_sender(m_task_t task);
+m_host_t MSG_task_get_source(m_task_t task);
 const char *MSG_task_get_name(m_task_t task);
 MSG_error_t MSG_task_cancel(m_task_t task);
 MSG_error_t MSG_task_destroy(m_task_t task);
 const char *MSG_task_get_name(m_task_t task);
 MSG_error_t MSG_task_cancel(m_task_t task);
 MSG_error_t MSG_task_destroy(m_task_t task);
index 2b46a58..01dfbff 100644 (file)
@@ -41,7 +41,7 @@ int xbt_fifo_size(xbt_fifo_t);
 int xbt_fifo_is_in(xbt_fifo_t, void *);
 /** @} */
 
 int xbt_fifo_is_in(xbt_fifo_t, void *);
 /** @} */
 
-/** @name 3. Manipulating directly items
+/** @name 3. Manipulating items directly
  *
  *  @{
  */
  *
  *  @{
  */
index ae67680..a5b2646 100644 (file)
@@ -296,6 +296,7 @@ MSG_error_t MSG_task_put(m_task_t task,
 
   task_simdata = task->simdata;
   task_simdata->sender = process;
 
   task_simdata = task->simdata;
   task_simdata->sender = process;
+  task_simdata->source = MSG_process_get_host(process);
   xbt_assert0(task_simdata->using==1,"Gargl!");
   task_simdata->comm = NULL;
   
   xbt_assert0(task_simdata->using==1,"Gargl!");
   task_simdata->comm = NULL;
   
@@ -481,6 +482,7 @@ m_task_t MSG_parallel_task_create(const char *name,
   simdata->rate = -1.0;
   simdata->using = 1;
   simdata->sender = NULL;
   simdata->rate = -1.0;
   simdata->using = 1;
   simdata->sender = NULL;
+  simdata->source = NULL;
   simdata->host_nb = host_nb;
   
   simdata->host_list = xbt_new0(void *, host_nb);
   simdata->host_nb = host_nb;
   
   simdata->host_list = xbt_new0(void *, host_nb);
index 7616d24..559d774 100644 (file)
@@ -36,6 +36,7 @@ typedef struct simdata_task {
   double computation_amount;   /* Computation size  */
   xbt_dynar_t sleeping;                /* process to wake-up */
   m_process_t sender;
   double computation_amount;   /* Computation size  */
   xbt_dynar_t sleeping;                /* process to wake-up */
   m_process_t sender;
+  m_host_t source;
   double priority;
   double rate;
   int using;
   double priority;
   double rate;
   int using;
index c353d75..b6c608a 100644 (file)
@@ -90,6 +90,17 @@ m_process_t MSG_task_get_sender(m_task_t task)
    return ((simdata_task_t) task->simdata)->sender;
 }
 
    return ((simdata_task_t) task->simdata)->sender;
 }
 
+/** \ingroup m_task_management
+ * \brief Return the source of a #m_task_t.
+ *
+ * This functions returns the #m_host_t from which this task was sent
+ */
+m_host_t MSG_task_get_source(m_task_t task)
+{
+   xbt_assert0(task, "Invalid parameters");
+   return ((simdata_task_t) task->simdata)->source;
+}
+
 /** \ingroup m_task_management
  * \brief Return the name of a #m_task_t.
  *
 /** \ingroup m_task_management
  * \brief Return the name of a #m_task_t.
  *