Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] functions needed to create graph configuration files for Triva by hand
authorschnorr <Lucas.Schnorr@imag.fr>
Thu, 5 Apr 2012 10:54:03 +0000 (12:54 +0200)
committerschnorr <Lucas.Schnorr@imag.fr>
Thu, 5 Apr 2012 12:03:05 +0000 (14:03 +0200)
include/instr/instr.h
src/instr/instr_interface.c

index c85831c..da7491c 100644 (file)
@@ -70,6 +70,10 @@ XBT_PUBLIC(void) TRACE_link_srcdst_variable_add_with_time (double time, const ch
 XBT_PUBLIC(void) TRACE_link_srcdst_variable_sub_with_time (double time, const char *src, const char *dst, const char *variable, double value);
 XBT_PUBLIC(xbt_dynar_t) TRACE_get_link_variables (void);
 
+/* for creating graph configuration files for Triva by hand */
+XBT_PUBLIC(xbt_dynar_t) TRACE_get_node_types (void);
+XBT_PUBLIC(xbt_dynar_t) TRACE_get_edge_types (void);
+
 #else                           /* HAVE_TRACING */
 
 #define TRACE_category(category)
@@ -110,6 +114,9 @@ XBT_PUBLIC(xbt_dynar_t) TRACE_get_link_variables (void);
 #define TRACE_link_srcdst_variable_sub_with_time(time,src,dst,var,value)
 #define TRACE_get_host_variables()
 
+#define TRACE_get_node_types()
+#define TRACE_get_edge_types()
+
 #endif                          /* HAVE_TRACING */
 
 #endif                          /* INSTR_H_ */
index 5b21402..3d582d8 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)
 {
@@ -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 */