Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] register of node and edge types that were defined during tracing
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 22 Dec 2010 18:37:52 +0000 (18:37 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 22 Dec 2010 18:37:52 +0000 (18:37 +0000)
details:
- they are used to generate triva graph configurations

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9313 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/instr_paje.c
src/instr/instr_private.h
src/instr/instr_routing.c

index 821e8da..f8ce9de 100644 (file)
@@ -13,14 +13,14 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_paje, instr, "Paje tracing event system (
 static type_t rootType = NULL;              /* the root type */
 static container_t rootContainer = NULL;    /* the root container */
 static xbt_dict_t allContainers = NULL;     /* all created containers indexed by name */
-xbt_dynar_t allLinkTypes = NULL;     /* all link types defined */
-xbt_dynar_t allHostTypes = NULL;     /* all host types defined */
+xbt_dict_t trivaNodeTypes = NULL;     /* all link types defined */
+xbt_dict_t trivaEdgeTypes = NULL;     /* all host types defined */
 
 void instr_paje_init (container_t root)
 {
   allContainers = xbt_dict_new ();
-  allLinkTypes = xbt_dynar_new (sizeof(s_type_t), NULL);
-  allHostTypes = xbt_dynar_new (sizeof(s_type_t), NULL);
+  trivaNodeTypes = xbt_dict_new ();
+  trivaEdgeTypes = xbt_dict_new ();
   rootContainer = root;
 }
 
@@ -192,16 +192,9 @@ container_t newContainer (const char *name, e_container_types kind, container_t
   //register hosts, routers, links containers
   if (new->kind == INSTR_HOST || new->kind == INSTR_LINK || new->kind == INSTR_ROUTER) {
     xbt_dict_set (allContainers, new->name, new, NULL);
-  }
-
-  //register the host container types
-  if (new->kind == INSTR_HOST){
-    xbt_dynar_push_as (allHostTypes, type_t, new->type);
-  }
 
-  //register the link container types
-  if (new->kind == INSTR_LINK){
-    xbt_dynar_push_as(allLinkTypes, type_t, new->type);
+    //register NODE types for triva configuration
+    xbt_dict_set (trivaNodeTypes, new->type->name, xbt_strdup("1"), xbt_free);
   }
   return new;
 }
index e7d8355..424a5e3 100644 (file)
@@ -217,6 +217,8 @@ void TRACE_sd_task_create(SD_task_t task);
 void TRACE_sd_task_destroy(SD_task_t task);
 
 /* instr_paje.c */
+extern xbt_dict_t trivaNodeTypes;
+extern xbt_dict_t trivaEdgeTypes;
 container_t newContainer (const char *name, e_container_types kind, container_t father);
 container_t getContainer (const char *name);
 container_t getContainerByName (const char *name);
index de16ae5..15cd349 100644 (file)
@@ -67,6 +67,9 @@ static void linkContainers (const char *a1, const char *a2)
   snprintf (link_typename, INSTR_DEFAULT_STR_SIZE, "%s-%s", a1_type->name, a2_type->name);
   type_t link_type = getLinkType (link_typename, container->type, a1_type, a2_type);
 
+  //register EDGE types for triva configuration
+  xbt_dict_set (trivaEdgeTypes, link_type->name, xbt_strdup("1"), xbt_free);
+
   //create the link
   static long long counter = 0;
   char key[INSTR_DEFAULT_STR_SIZE];