static char *gw_src = NULL; /* temporary store the gateway source name of a route */
static char *gw_dst = NULL; /* temporary store the gateway destination name of a route */
static double_f_cpvoid_t get_link_latency = NULL;
-xbt_dict_t cluster_host_link = NULL; /* for tag cluster */
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
{"Vivaldi", "Vivaldi routing", model_vivaldi_create,
model_none_load, model_none_unload, model_none_end},
{"Cluster", "Cluster routing", model_cluster_create,
- model_none_load, model_none_unload, model_none_end},
+ model_none_load, model_cluster_unload, model_none_end},
{NULL, NULL, NULL, NULL, NULL, NULL}
};
void routing_parse_Scluster(void)
{
- if(!cluster_host_link)
- cluster_host_link = xbt_dict_new();
-
static int AX_ptr = 0;
char *host_id, *groups, *link_id = NULL;
info->link_up = xbt_lib_get_or_null(link_lib, link_id, SURF_LINK_LEVEL);
info->link_down = info->link_up;
}
- xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
+ surf_routing_cluster_add_link(host_id,info);
xbt_free(link_id);
xbt_free(host_id);
info->link_up = xbt_lib_get_or_null(link_lib, link_id, SURF_LINK_LEVEL);
info->link_down = info->link_up;
}
- xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
+ surf_routing_cluster_add_link(host_id,info);
+
xbt_free(link_id);
xbt_free(host_id);
surf_parsing_link_up_down_t info = xbt_new0(s_surf_parsing_link_up_down_t, 1);
info->link_up = xbt_lib_get_or_null(link_lib, link_backbone, SURF_LINK_LEVEL);
info->link_down = info->link_up;
- xbt_dict_set(cluster_host_link,struct_cluster->id,info,xbt_free);
+ surf_routing_cluster_add_link(struct_cluster->id, info);
+
free(link_backbone);
}
/* Global vars */
extern routing_global_t global_routing;
-extern routing_component_t current_routing;
-extern model_type_t current_routing_model;
-extern xbt_dynar_t link_list;
-extern xbt_dict_t cluster_host_link;
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
* Note that a router is created, easing the interconnexion with the rest of the world.
*/
+static xbt_dict_t cluster_host_link = NULL; /* for tag cluster */
+
typedef struct {
s_routing_component_t generic_routing;
xbt_dict_t dict_processing_units;
return new_component;
}
+void model_cluster_unload(void) {
+// xbt_dict_free(&cluster_host_link); //FIXME: do it once the module management is clean in routing
+}
+
+void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info) {
+ if(!cluster_host_link)
+ cluster_host_link = xbt_dict_new();
+
+ xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
+}