X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1b30f00857843f1cee60814ed519ff82e8ef4787..5de55298b58930e1c9f0d92bafa39e91ce55fc05:/src/instr/surf_instr.c diff --git a/src/instr/surf_instr.c b/src/instr/surf_instr.c index 81a2be7c3c..0660513173 100644 --- a/src/instr/surf_instr.c +++ b/src/instr/surf_instr.c @@ -11,7 +11,6 @@ */ #include "instr/private.h" -#include "instr/config.h" #ifdef HAVE_TRACING @@ -23,6 +22,7 @@ static xbt_dict_t hosts_id; static xbt_dict_t created_links; static xbt_dict_t link_bandwidth; static xbt_dict_t link_latency; +static xbt_dict_t host_containers; //static xbt_dict_t platform_variable_last_value; /* to control the amount of add/sub variables events*/ //static xbt_dict_t platform_variable_last_time; /* to control the amount of add/sub variables events*/ @@ -44,6 +44,7 @@ void __TRACE_surf_init (void) link_bandwidth = xbt_dict_new(); link_latency = xbt_dict_new(); platform_variables = xbt_dict_new(); + host_containers = xbt_dict_new(); //platform_variable_last_value = xbt_dict_new(); //platform_variable_last_time = xbt_dict_new(); @@ -300,7 +301,10 @@ void TRACE_surf_net_link_new (char *name, double bw, double lat) void TRACE_surf_cpu_new (char *name, double power) { if (!IS_TRACING) return; - if (IS_TRACING_PLATFORM) pajeCreateContainer (SIMIX_get_clock(), name, "HOST", "platform", name); + if (IS_TRACING_PLATFORM){ + pajeCreateContainer (SIMIX_get_clock(), name, "HOST", "platform", name); + xbt_dict_set (host_containers, xbt_strdup(name), xbt_strdup("1"), xbt_free); + } __TRACE_surf_set_resource_variable (SIMIX_get_clock(), "power", name, power); } @@ -415,4 +419,18 @@ void TRACE_surf_missing_link (void) THROW0(tracing_error, TRACE_ERROR_COMPLEX_ROUTES, "Tracing failed"); } +void TRACE_msg_clean (void) +{ + __TRACE_surf_finalize(); + + xbt_dict_cursor_t cursor = NULL; + unsigned int cursor_ar = 0; + char *key, *value; + + /* get all host from host_containers */ + xbt_dict_foreach(host_containers, cursor, key, value) { + if (IS_TRACING_PLATFORM) pajeDestroyContainer (MSG_get_clock(), "HOST", key); + } +} + #endif