-
- /* get all host from host_containers */
- xbt_dict_foreach(host_containers, cursor, key, value) {
- pajeDestroyContainer(MSG_get_clock(), "HOST", key);
- }
- xbt_dict_foreach(created_links, cursor, key, value) {
- pajeDestroyContainer(MSG_get_clock(), "LINK", key);
- }
-}
-
-static void TRACE_surf_set_resource_variable(double date,
- const char *variable,
- const char *resource,
- double value)
-{
- char aux[100], key[100];
- char *last_value = NULL;
- if (!TRACE_is_active())
- return;
- snprintf(aux, 100, "%f", value);
- snprintf(key, 100, "%s#%s", resource, variable);
-
- last_value = xbt_dict_get_or_null(resource_variables, key);
- if (last_value) {
- if (atof(last_value) == value) {
- return;
- }
- }
- pajeSetVariable(date, variable, resource, aux);
- xbt_dict_set(resource_variables, xbt_strdup(key), xbt_strdup(aux),
- xbt_free);
-}
-
-/*
- * TRACE_surf_link_declaration (name, bandwidth, latency): this function
- * saves the bandwidth and latency of a link identified by name. This
- * information is used in the future to create the link container in the trace.
- *
- * caller: net_link_new (from each network model)
- * main: create LINK container, set initial bandwidth and latency
- * return: void
- */
-void TRACE_surf_link_declaration(void *link, char *name, double bw,
- double lat)
-{
- if (!TRACE_is_active())
- return;
-
- if (!link){
- xbt_die ("link is NULL");
- }
-
- //filter out loopback
- if (!strcmp(name, "loopback") || !strcmp(name, "__loopback__"))
- return;
-
- char alias[100];
- snprintf(alias, 100, "%p", link);
- pajeCreateContainer(SIMIX_get_clock(), alias, "LINK", "platform", name);
- xbt_dict_set(created_links, alias, xbt_strdup("1"), xbt_free);
- TRACE_surf_link_set_bandwidth(SIMIX_get_clock(), link, bw);
- TRACE_surf_link_set_latency(SIMIX_get_clock(), link, lat);