Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[route parsing] rename network_element_t into sg_routing_edge_t
[simgrid.git] / src / instr / instr_interface.c
index 5b21402..763d75f 100644 (file)
@@ -23,6 +23,8 @@ xbt_dict_t created_categories = NULL;
 xbt_dict_t declared_marks = NULL;
 xbt_dict_t user_host_variables = NULL;
 xbt_dict_t user_link_variables = NULL;
+extern xbt_dict_t trivaNodeTypes;
+extern xbt_dict_t trivaEdgeTypes;
 
 static xbt_dynar_t instr_dict_to_dynar (xbt_dict_t filter)
 {
@@ -238,7 +240,7 @@ static void instr_user_variable(double time,
   if (!TRACE_needs_platform()) return;
 
   //check if variable is already declared
-  char *created = xbt_dict_get_or_null(declared_marks, variable);
+  char *created = xbt_dict_get_or_null(filter, variable);
   if (what == INSTR_US_DECLARE){
     if (created){
       //already declared
@@ -296,11 +298,11 @@ static void instr_user_srcdst_variable(double time,
                               InstrUserVariable what)
 {
   xbt_dynar_t route=NULL;
-  network_element_t src_elm = xbt_lib_get_or_null(host_lib,src,ROUTING_HOST_LEVEL);
+  sg_routing_edge_t src_elm = xbt_lib_get_or_null(host_lib,src,ROUTING_HOST_LEVEL);
   if(!src_elm) src_elm = xbt_lib_get_or_null(as_router_lib,src,ROUTING_ASR_LEVEL);
   if(!src_elm) xbt_die("Element '%s' not found!",src);
 
-  network_element_t dst_elm = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
+  sg_routing_edge_t dst_elm = xbt_lib_get_or_null(host_lib,dst,ROUTING_HOST_LEVEL);
   if(!dst_elm) dst_elm = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
   if(!dst_elm) xbt_die("Element '%s' not found!",dst);
 
@@ -787,4 +789,32 @@ xbt_dynar_t TRACE_get_link_variables (void)
   return instr_dict_to_dynar (user_link_variables);
 }
 
+/** \ingroup TRACE_API
+ *  \brief Get Paje container types that can be mapped to the nodes of a graph.
+ *
+ *  This function can be used to create a user made
+ *  graph configuration file for Triva. Normally, it is
+ *  used with the functions defined in \ref TRACE_user_variables.
+ *
+ *  \return A dynar with the types, must be freed with xbt_dynar_free.
+ */
+xbt_dynar_t TRACE_get_node_types (void)
+{
+  return instr_dict_to_dynar (trivaNodeTypes);
+}
+
+/** \ingroup TRACE_API
+ *  \brief Get Paje container types that can be mapped to the edges of a graph.
+ *
+ *  This function can be used to create a user made
+ *  graph configuration file for Triva. Normally, it is
+ *  used with the functions defined in \ref TRACE_user_variables.
+ *
+ *  \return A dynar with the types, must be freed with xbt_dynar_free.
+ */
+xbt_dynar_t TRACE_get_edge_types (void)
+{
+  return instr_dict_to_dynar (trivaEdgeTypes);
+}
+
 #endif /* HAVE_TRACING */