details:
- instr_id (resource_name) gives the right alias
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9188
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
int instr_link_is_traced (const char *name);
char *instr_link_type (const char *name);
char *instr_host_type (const char *name);
int instr_link_is_traced (const char *name);
char *instr_link_type (const char *name);
char *instr_host_type (const char *name);
+char *instr_id (const char *name);
void instr_destroy_platform (void);
#endif /* HAVE_TRACING */
void instr_destroy_platform (void);
#endif /* HAVE_TRACING */
if (!TRACE_is_active())
return;
DEBUG6("EVENT %p [%f - %f] %s %s %f", action, now, now+delta, resource, variable, value);
if (!TRACE_is_active())
return;
DEBUG6("EVENT %p [%f - %f] %s %s %f", action, now, now+delta, resource, variable, value);
- TRACE_method_event(action, now, delta, variable, resource, value);
+ TRACE_method_event(action, now, delta, variable, instr_id(resource), value);
}
void TRACE_surf_resource_utilization_end(smx_action_t action)
}
void TRACE_surf_resource_utilization_end(smx_action_t action)
typedef struct s_container *container_t;
typedef struct s_container {
typedef struct s_container *container_t;
typedef struct s_container {
- char *name; /* Unique id of this container */
+ char *name; /* Unique name of this container */
+ char *id; /* Unique id of this container */
char *type; /* Type of this container */
char *typename; /* Type name of this container */
int level; /* Level in the hierarchy, root level is 0 */
char *type; /* Type of this container */
char *typename; /* Type name of this container */
int level; /* Level in the hierarchy, root level is 0 */
surfxml_add_callback(ETag_surfxml_platform_cb_list, &instr_routing_parse_end_platform);
}
surfxml_add_callback(ETag_surfxml_platform_cb_list, &instr_routing_parse_end_platform);
}
+static long long int newContainedId ()
+{
+ static long long counter = 0;
+ return counter++;
+}
static container_t newContainer (const char *name, const char *type, e_container_types kind)
{
static container_t newContainer (const char *name, const char *type, e_container_types kind)
{
+ long long int counter = newContainedId();
+ char id_str[INSTR_DEFAULT_STR_SIZE];
+ snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
+
container_t newContainer = xbt_new0(s_container_t, 1);
newContainer->name = xbt_strdup (name);
container_t newContainer = xbt_new0(s_container_t, 1);
newContainer->name = xbt_strdup (name);
+ newContainer->id = xbt_strdup (id_str);
newContainer->father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
newContainer->level = newContainer->father->level+1;
newContainer->type = xbt_strdup (type);
newContainer->father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
newContainer->level = newContainer->father->level+1;
newContainer->type = xbt_strdup (type);
xbt_dict_set(newContainer->father->children, newContainer->name, newContainer, NULL);
newContainerType (newContainer->type, newContainer->father->type, newContainer->typename);
xbt_dict_set(newContainer->father->children, newContainer->name, newContainer, NULL);
newContainerType (newContainer->type, newContainer->father->type, newContainer->typename);
- pajeCreateContainer (0, newContainer->name, newContainer->type, newContainer->father->name, newContainer->name);
+ pajeCreateContainer (0, newContainer->id, newContainer->type, newContainer->father->id, newContainer->name);
recursiveDestroyContainer (child);
}
recursiveDestroyContainer (child);
}
- pajeDestroyContainer(SIMIX_get_clock(), container->type, container->name);
+ pajeDestroyContainer(SIMIX_get_clock(), container->type, container->id);
xbt_free (container->name);
xbt_free (container->name);
+ xbt_free (container->id);
xbt_free (container->type);
xbt_free (container->children);
xbt_free (container);
xbt_free (container->type);
xbt_free (container->children);
xbt_free (container);
if (strcmp (a1, "__loopback__") == 0 || strcmp (a2, "__loopback__") == 0)
return;
if (strcmp (a1, "__loopback__") == 0 || strcmp (a2, "__loopback__") == 0)
return;
+ char *a1_id = ((container_t)xbt_dict_get (allContainers, a1))->id;
char *a1_type = ((container_t)xbt_dict_get (allContainers, a1))->type;
char *a1_typename = ((container_t)xbt_dict_get (allContainers, a1))->typename;
char *a1_type = ((container_t)xbt_dict_get (allContainers, a1))->type;
char *a1_typename = ((container_t)xbt_dict_get (allContainers, a1))->typename;
+ char *a2_id = ((container_t)xbt_dict_get (allContainers, a2))->id;
char *a2_type = ((container_t)xbt_dict_get (allContainers, a2))->type;
char *a2_typename = ((container_t)xbt_dict_get (allContainers, a2))->typename;
char *a2_type = ((container_t)xbt_dict_get (allContainers, a2))->type;
char *a2_typename = ((container_t)xbt_dict_get (allContainers, a2))->typename;
//create the link
static long long counter = 0;
char key[INSTR_DEFAULT_STR_SIZE];
//create the link
static long long counter = 0;
char key[INSTR_DEFAULT_STR_SIZE];
- snprintf (key, INSTR_DEFAULT_STR_SIZE, "G%lld", counter++);
- pajeStartLink(SIMIX_get_clock(), new_link_type, container->name, "graph", a1, key);
- pajeEndLink(SIMIX_get_clock(), new_link_type, container->name, "graph", a2, key);
+ snprintf (key, INSTR_DEFAULT_STR_SIZE, "%lld", counter++);
+ pajeStartLink(SIMIX_get_clock(), new_link_type, container->id, "G", a1_id, key);
+ pajeEndLink(SIMIX_get_clock(), new_link_type, container->id, "G", a2_id, key);
}
static void recursiveGraphExtraction (container_t container)
}
static void recursiveGraphExtraction (container_t container)
if (rootContainer == NULL){
rootContainer = xbt_new0(s_container_t, 1);
rootContainer->name = xbt_strdup ("0");
if (rootContainer == NULL){
rootContainer = xbt_new0(s_container_t, 1);
rootContainer->name = xbt_strdup ("0");
+ rootContainer->id = xbt_strdup (rootContainer->name);
rootContainer->type = xbt_strdup ("0");
rootContainer->typename = xbt_strdup ("0");
rootContainer->level = 0;
rootContainer->type = xbt_strdup ("0");
rootContainer->typename = xbt_strdup ("0");
rootContainer->level = 0;
links_types = xbt_dict_new ();
}
links_types = xbt_dict_new ();
}
+ long long int counter = newContainedId();
+ char id_str[INSTR_DEFAULT_STR_SIZE];
+ snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
+
container_t newContainer = xbt_new0(s_container_t, 1);
newContainer->name = xbt_strdup (A_surfxml_AS_id);
container_t newContainer = xbt_new0(s_container_t, 1);
newContainer->name = xbt_strdup (A_surfxml_AS_id);
+ newContainer->id = xbt_strdup (id_str);
newContainer->father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
newContainer->level = newContainer->father->level+1;
newContainer->type = instr_AS_type (newContainer->level);
newContainer->father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
newContainer->level = newContainer->father->level+1;
newContainer->type = instr_AS_type (newContainer->level);
//trace
newContainerType (newContainer->type, newContainer->father->type, newContainer->type);
//trace
newContainerType (newContainer->type, newContainer->father->type, newContainer->type);
- pajeCreateContainer (0, newContainer->name, newContainer->type, newContainer->father->name, newContainer->name);
+ pajeCreateContainer (0, newContainer->id, newContainer->type, newContainer->father->id, newContainer->name);
//push
xbt_dynar_push (currentContainer, newContainer);
//push
xbt_dynar_push (currentContainer, newContainer);
snprintf (latency_type, INSTR_DEFAULT_STR_SIZE, "latency-%s", type);
newVariableType (bandwidth_type, type, "bandwidth", NULL);
newVariableType (latency_type, type, "latency", NULL);
snprintf (latency_type, INSTR_DEFAULT_STR_SIZE, "latency-%s", type);
newVariableType (bandwidth_type, type, "bandwidth", NULL);
newVariableType (latency_type, type, "latency", NULL);
- pajeSetVariable(0, bandwidth_type, new->name, A_surfxml_link_bandwidth);
- pajeSetVariable(0, latency_type, new->name, A_surfxml_link_latency);
+ pajeSetVariable(0, bandwidth_type, new->id, A_surfxml_link_bandwidth);
+ pajeSetVariable(0, latency_type, new->id, A_surfxml_link_latency);
if (TRACE_uncategorized()){
//bandwidth_used
if (TRACE_uncategorized()){
//bandwidth_used
char power_type[INSTR_DEFAULT_STR_SIZE];
snprintf (power_type, INSTR_DEFAULT_STR_SIZE, "power-%s", type);
newVariableType (power_type, type, "power", NULL);
char power_type[INSTR_DEFAULT_STR_SIZE];
snprintf (power_type, INSTR_DEFAULT_STR_SIZE, "power-%s", type);
newVariableType (power_type, type, "power", NULL);
- pajeSetVariable(0, power_type, new->name, A_surfxml_host_power);
+ pajeSetVariable(0, power_type, new->id, A_surfxml_host_power);
if (TRACE_uncategorized()){
//power_used
if (TRACE_uncategorized()){
//power_used
return ((container_t)xbt_dict_get (allContainers, name))->type;
}
return ((container_t)xbt_dict_get (allContainers, name))->type;
}
+char *instr_id (const char *name)
+{
+ return ((container_t)xbt_dict_get (allContainers, name))->id;
+}
+
void instr_destroy_platform ()
{
if (rootContainer) recursiveDestroyContainer (rootContainer);
void instr_destroy_platform ()
{
if (rootContainer) recursiveDestroyContainer (rootContainer);
{
char value_str[INSTR_DEFAULT_STR_SIZE];
snprintf(value_str, 100, "%f", value);
{
char value_str[INSTR_DEFAULT_STR_SIZE];
snprintf(value_str, 100, "%f", value);
- pajeSetVariable(date, variable, resource, value_str);
+ pajeSetVariable(date, variable, instr_id(resource), value_str);
}
void TRACE_surf_host_set_power(double date, const char *resource, double power)
}
void TRACE_surf_host_set_power(double date, const char *resource, double power)
snprintf (variable_type, INSTR_DEFAULT_STR_SIZE, "%s-%s", variable, link_type);
if (strcmp(what, "set") == 0) {
snprintf (variable_type, INSTR_DEFAULT_STR_SIZE, "%s-%s", variable, link_type);
if (strcmp(what, "set") == 0) {
- pajeSetVariable(time, variable_type, resource, valuestr);
+ pajeSetVariable(time, variable_type, instr_id(resource), valuestr);
} else if (strcmp(what, "add") == 0) {
} else if (strcmp(what, "add") == 0) {
- pajeAddVariable(time, variable_type, resource, valuestr);
+ pajeAddVariable(time, variable_type, instr_id(resource), valuestr);
} else if (strcmp(what, "sub") == 0) {
} else if (strcmp(what, "sub") == 0) {
- pajeSubVariable(time, variable_type, resource, valuestr);
+ pajeSubVariable(time, variable_type, instr_id(resource), valuestr);
snprintf (variable_type, INSTR_DEFAULT_STR_SIZE, "%s-%s", variable, host_type);
if (strcmp(what, "set") == 0) {
snprintf (variable_type, INSTR_DEFAULT_STR_SIZE, "%s-%s", variable, host_type);
if (strcmp(what, "set") == 0) {
- pajeSetVariable(time, variable_type, host_name, valuestr);
+ pajeSetVariable(time, variable_type, instr_id(host_name), valuestr);
} else if (strcmp(what, "add") == 0) {
} else if (strcmp(what, "add") == 0) {
- pajeAddVariable(time, variable_type, host_name, valuestr);
+ pajeAddVariable(time, variable_type, instr_id(host_name), valuestr);
} else if (strcmp(what, "sub") == 0) {
} else if (strcmp(what, "sub") == 0) {
- pajeSubVariable(time, variable_type, host_name, valuestr);
+ pajeSubVariable(time, variable_type, instr_id(host_name), valuestr);