Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 27 Sep 2012 11:45:46 +0000 (13:45 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 27 Sep 2012 11:45:46 +0000 (13:45 +0200)
1  2 
src/msg/msg_gos.c

diff --combined src/msg/msg_gos.c
@@@ -294,7 -294,9 +294,9 @@@ XBT_INLINE msg_comm_t MSG_task_isend_wi
    msg_process_t process = MSG_process_self();
    msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
  
-   /* FIXME: these functions are not traceable */
+ #ifdef HAVE_TRACING
+   int call_end = TRACE_msg_task_put_start(task);
+ #endif
  
    /* Prepare the task to send */
    t_simdata = task->simdata;
      simcall_comm_isend(mailbox, t_simdata->message_size,
                           t_simdata->rate, task, sizeof(void *), match_fun, NULL, match_data, 0);
    t_simdata->comm = comm->s_comm; /* FIXME: is the field t_simdata->comm still useful? */
+ #ifdef HAVE_TRACING
+     if (TRACE_is_enabled()) {
+       simcall_set_category(comm->s_comm, task->category);
+     }
+ #endif
+ #ifdef HAVE_TRACING
+   if (call_end)
+     TRACE_msg_task_put_end();
+ #endif
  
    return comm;
  }
@@@ -344,8 -356,6 +356,6 @@@ void MSG_task_dsend(msg_task_t task, co
    msg_process_t process = MSG_process_self();
    msg_mailbox_t mailbox = MSG_mailbox_get_by_alias(alias);
  
-   /* FIXME: these functions are not traceable */
    /* Prepare the task to send */
    t_simdata = task->simdata;
    t_simdata->sender = process;
    t_simdata->comm = NULL;
    msg_global->sent_msg++;
  
+ #ifdef HAVE_TRACING
+   int call_end = TRACE_msg_task_put_start(task);
+ #endif
    /* Send it by calling SIMIX network layer */
    smx_action_t comm = simcall_comm_isend(mailbox, t_simdata->message_size,
                         t_simdata->rate, task, sizeof(void *), NULL, cleanup, NULL, 1);
    t_simdata->comm = comm;
+ #ifdef HAVE_TRACING
+     if (TRACE_is_enabled()) {
+       simcall_set_category(comm, task->category);
+     }
+ #endif
+ #ifdef HAVE_TRACING
+   if (call_end)
+     TRACE_msg_task_put_end();
+ #endif
  }
  
  /** \ingroup msg_task_usage
@@@ -640,7 -664,7 +664,7 @@@ msg_task_t MSG_comm_get_task(msg_comm_
  }
  
  /**
 - * \brief This function is called by SIMIX to copy the data of a comm.
 + * \brief This function is called by SIMIX in kernel mode to copy the data of a comm.
   * \param comm the comm
   * \param buff the data copied
   * \param buff_size size of the buffer
@@@ -813,6 -837,42 +837,42 @@@ const char *MSG_task_get_category (msg_
  #endif
  }
  
+ /**
+  * \brief Returns the value of a given AS or router property
+  *
+  * \param asr the name of a router or AS
+  * \param name a property name
+  * \return value of a property (or NULL if property not set)
+  */
+ const char *MSG_as_router_get_property_value(const char* asr, const char *name)
+ {
+   return xbt_dict_get_or_null(MSG_as_router_get_properties(asr), name);
+ }
+ /**
+  * \brief Returns a xbt_dict_t consisting of the list of properties assigned to
+  * a the AS or router
+  *
+  * \param asr the name of a router or AS
+  * \return a dict containing the properties
+  */
+ xbt_dict_t MSG_as_router_get_properties(const char* asr)
+ {
+   return (simcall_asr_get_properties(asr));
+ }
+ /**
+  * \brief Change the value of a given AS or router
+  *
+  * \param asr the name of a router or AS
+  * \param name a property name
+  * \param value what to change the property to
+  * \param free_ctn the freeing function to use to kill the value on need
+  */
+ void MSG_as_router_set_property_value(const char* asr, const char *name, char *value,void_f_pvoid_t free_ctn) {
+   xbt_dict_set(MSG_as_router_get_properties(asr), name, value,free_ctn);
+ }
  #ifdef MSG_USE_DEPRECATED
  /** \ingroup msg_deprecated_functions
   *