From: Lucas Schnorr Date: Fri, 20 Jan 2012 14:14:51 +0000 (+0100) Subject: [trace] separate initialization function from setting the root container X-Git-Tag: exp_20120216~119^2~59 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f9b51727aa8da06d621c0e3ed653484bf0d64ba4 [trace] separate initialization function from setting the root container --- diff --git a/src/instr/instr_paje.c b/src/instr/instr_paje.c index 4b2c73119c..88a5fb80a8 100644 --- a/src/instr/instr_paje.c +++ b/src/instr/instr_paje.c @@ -16,11 +16,15 @@ static xbt_dict_t allContainers = NULL; /* all created containers indexed by 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) +void instr_paje_init (void) { allContainers = xbt_dict_new_homogeneous(NULL); trivaNodeTypes = xbt_dict_new_homogeneous(xbt_free); trivaEdgeTypes = xbt_dict_new_homogeneous(xbt_free); +} + +void instr_paje_set_root (container_t root) +{ rootContainer = root; } diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 5888ca723f..875fa0f012 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -208,7 +208,8 @@ container_t getContainerByName (const char *name); char *getContainerIdByName (const char *name); char *getVariableTypeIdByName (const char *name, type_t father); container_t getRootContainer (void); -void instr_paje_init (container_t root); +void instr_paje_init (void); +void instr_paje_set_root (container_t root); void instr_paje_free (void); type_t getRootType (void); type_t getContainerType (const char *name, type_t father); diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 2a1dc65ffc..398d0cd292 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -163,8 +163,10 @@ static void recursiveGraphExtraction (AS_t rc, container_t container, xbt_dict_t static void instr_routing_parse_start_AS (const char*id,const char*routing) { if (getRootContainer() == NULL){ + instr_paje_init (); container_t root = newContainer (id, INSTR_AS, NULL); - instr_paje_init (root); + instr_paje_set_root (root); + if (TRACE_smpi_is_enabled()) { if (!TRACE_smpi_is_grouped()){