" size = power;\n"
" values = (");
xbt_dict_foreach(created_categories,cursor2,name2,value2) {
- fprintf (file, "%s, ", name2);
+ fprintf (file, "p%s, ", name2);
}
fprintf (file,
");\n"
" size = bandwidth;\n"
" values = (");
xbt_dict_foreach(created_categories,cursor2,name2,value2) {
- fprintf (file, "%s, ", name2);
+ fprintf (file, "b%s, ", name2);
}
fprintf (file,
");\n"
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;
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;
*/
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;