Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
if tracing category X is created, define pX for hosts, bX for links
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Tue, 5 Apr 2011 16:19:24 +0000 (18:19 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Tue, 5 Apr 2011 16:19:24 +0000 (18:19 +0200)
details:
- avoids confusion when doing spatial aggregation with
the triva's hierarchical graph view

src/instr/instr_config.c
src/instr/instr_resource_utilization.c
src/instr/instr_routing.c

index defc1f5..8aad85e 100644 (file)
@@ -445,7 +445,7 @@ void TRACE_generate_triva_cat_conf (void)
         "    size = power;\n"
         "    values = (");
     xbt_dict_foreach(created_categories,cursor2,name2,value2) {
-      fprintf (file, "%s, ", name2);
+      fprintf (file, "p%s, ", name2);
     }
     fprintf (file,
         ");\n"
@@ -455,7 +455,7 @@ void TRACE_generate_triva_cat_conf (void)
         "    size = bandwidth;\n"
         "    values = (");
     xbt_dict_foreach(created_categories,cursor2,name2,value2) {
-      fprintf (file, "%s, ", name2);
+      fprintf (file, "b%s, ", name2);
     }
     fprintf (file,
         ");\n"
index 1e4cdf7..f80332e 100644 (file)
@@ -308,9 +308,12 @@ void TRACE_surf_link_set_utilization(const char *resource, smx_action_t smx_acti
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
-    XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+    //variable of this category starts by 'b', because we have a link here
+    char category_type[INSTR_DEFAULT_STR_SIZE];
+    snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "b%s", surf_action->category);
+    XBT_DEBUG("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
     container_t container = getContainerByName (resource);
-    type_t type = getVariableType(surf_action->category, NULL, container->type);
+    type_t type = getVariableType(category_type, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
   }
   return;
@@ -342,9 +345,12 @@ void TRACE_surf_host_set_utilization(const char *resource,
   if (TRACE_categorized()){
     if (!surf_action->category)
       return;
-    XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, surf_action->category, value);
+    //variable of this category starts by 'p', because we have a host here
+    char category_type[INSTR_DEFAULT_STR_SIZE];
+    snprintf (category_type, INSTR_DEFAULT_STR_SIZE, "p%s", surf_action->category);
+    XBT_DEBUG("CAT HOST [%f - %f] %s %s %f", now, now+delta, resource, category_type, value);
     container_t container = getContainerByName (resource);
-    type_t type = getVariableType(surf_action->category, NULL, container->type);
+    type_t type = getVariableType(category_type, NULL, container->type);
     TRACE_surf_resource_utilization_event(smx_action, now, delta, type->name, container->name, value);
   }
   return;
index 3dc8126..9609830 100644 (file)
@@ -298,8 +298,15 @@ void instr_routing_define_callbacks ()
  */
 static void recursiveNewUserVariableType (const char *new_typename, const char *color, type_t root)
 {
-  if (!strcmp (root->name, "HOST") || !strcmp (root->name, "LINK")){
-    getVariableType(new_typename, color, root);
+  if (!strcmp (root->name, "HOST")){
+    char tnstr[INSTR_DEFAULT_STR_SIZE];
+    snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "p%s", new_typename);
+    getVariableType(tnstr, color, root);
+  }
+  if (!strcmp (root->name, "LINK")){
+    char tnstr[INSTR_DEFAULT_STR_SIZE];
+    snprintf (tnstr, INSTR_DEFAULT_STR_SIZE, "b%s", new_typename);
+    getVariableType(tnstr, color, root);
   }
   xbt_dict_cursor_t cursor = NULL;
   type_t child_type;