A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move scripts to generate g5k into the right directory.
[simgrid.git]
/
src
/
instr
/
instr_paje.c
diff --git
a/src/instr/instr_paje.c
b/src/instr/instr_paje.c
index
8b300ed
..
b523297
100644
(file)
--- a/
src/instr/instr_paje.c
+++ b/
src/instr/instr_paje.c
@@
-18,9
+18,9
@@
xbt_dict_t trivaEdgeTypes = NULL; /* all host types defined */
void instr_paje_init (container_t root)
{
void instr_paje_init (container_t root)
{
- allContainers = xbt_dict_new
(
);
- trivaNodeTypes = xbt_dict_new
(
);
- trivaEdgeTypes = xbt_dict_new
(
);
+ allContainers = xbt_dict_new
_homogeneous(NULL
);
+ trivaNodeTypes = xbt_dict_new
_homogeneous(xbt_free
);
+ trivaEdgeTypes = xbt_dict_new
_homogeneous(xbt_free
);
rootContainer = root;
}
rootContainer = root;
}
@@
-70,8
+70,8
@@
static type_t newType (const char *typename, const char *key, const char *color,
ret->name = xbt_strdup (typename);
ret->father = father;
ret->kind = kind;
ret->name = xbt_strdup (typename);
ret->father = father;
ret->kind = kind;
- ret->children = xbt_dict_new
(
);
- ret->values = xbt_dict_new
(
);
+ ret->children = xbt_dict_new
_homogeneous(NULL
);
+ ret->values = xbt_dict_new
_homogeneous(NULL
);
ret->color = xbt_strdup (color);
char str_id[INSTR_DEFAULT_STR_SIZE];
ret->color = xbt_strdup (color);
char str_id[INSTR_DEFAULT_STR_SIZE];
@@
-215,7
+215,7
@@
container_t newContainer (const char *name, e_container_types kind, container_t
default: xbt_die ("Congratulations, you have found a bug on newContainer function of instr_routing.c"); break;
}
}
default: xbt_die ("Congratulations, you have found a bug on newContainer function of instr_routing.c"); break;
}
}
- new->children = xbt_dict_new
(
);
+ new->children = xbt_dict_new
_homogeneous(NULL
);
if (new->father){
xbt_dict_set(new->father->children, new->name, new, NULL);
new_pajeCreateContainer (new);
if (new->father){
xbt_dict_set(new->father->children, new->name, new, NULL);
new_pajeCreateContainer (new);
@@
-226,13
+226,14
@@
container_t newContainer (const char *name, e_container_types kind, container_t
xbt_dict_set (allContainers, new->name, new, NULL);
//register NODE types for triva configuration
xbt_dict_set (allContainers, new->name, new, NULL);
//register NODE types for triva configuration
- xbt_dict_set (trivaNodeTypes, new->type->name, xbt_strdup("1"),
xbt_free
);
+ xbt_dict_set (trivaNodeTypes, new->type->name, xbt_strdup("1"),
NULL
);
}
return new;
}
static container_t recursiveGetContainer (const char *name, container_t root)
{
}
return new;
}
static container_t recursiveGetContainer (const char *name, container_t root)
{
+ if (name == NULL || root == NULL) return NULL;
if (strcmp (root->name, name) == 0) return root;
xbt_dict_cursor_t cursor = NULL;
if (strcmp (root->name, name) == 0) return root;
xbt_dict_cursor_t cursor = NULL;
@@
-247,6
+248,7
@@
static container_t recursiveGetContainer (const char *name, container_t root)
container_t getContainer (const char *name)
{
container_t getContainer (const char *name)
{
+ if (name == NULL) return NULL;
return recursiveGetContainer(name, rootContainer);
}
return recursiveGetContainer(name, rootContainer);
}
@@
-308,7
+310,10
@@
void destroyContainer (container_t container)
TRACE_paje_dump_buffer(1);
//trace my destruction
TRACE_paje_dump_buffer(1);
//trace my destruction
- new_pajeDestroyContainer(container);
+ if (!TRACE_disable_destroy()){
+ //do not trace the container destruction if user requests
+ new_pajeDestroyContainer(container);
+ }
//free
xbt_free (container->name);
//free
xbt_free (container->name);