summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d2c7a1a)
On the poor tests I've done, it seems to give a non negligible
improvement on the goal example. Maybe 5-10%, but it's hard to say
right now.
sg_platf_new_link(&link);
sg_platf_new_link(&link);
- 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;
- surf_routing_cluster_add_link(struct_cluster->id, info);
+ surf_routing_cluster_add_backbone(current_routing, xbt_lib_get_or_null(link_lib, link_backbone, SURF_LINK_LEVEL));
* Note that a router is created, easing the interconnexion with the rest of the world.
*/
* Note that a router is created, easing the interconnexion with the rest of the world.
*/
+typedef struct {
+ s_as_t generic_routing;
+ void *backbone;
+} s_as_cluster_t, *as_cluster_t;
+
+
static xbt_dict_t cluster_host_link = NULL;
/* Business methods */
static xbt_dict_t cluster_host_link = NULL;
/* Business methods */
info = xbt_dict_get_or_null(cluster_host_link,src);
if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_up
info = xbt_dict_get_or_null(cluster_host_link,src);
if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_up
- info = xbt_dict_get_or_null(cluster_host_link,as->name);
- if(info) xbt_dynar_push_as(links_list,void*,info->link_up); //link_bb
+ if ( ((as_cluster_t)as)->backbone )
+ xbt_dynar_push_as(links_list,void*, ((as_cluster_t)as)->backbone) ;
info = xbt_dict_get_or_null(cluster_host_link,dst);
if(info) xbt_dynar_push_as(links_list,void*,info->link_down); //link_down
info = xbt_dict_get_or_null(cluster_host_link,dst);
if(info) xbt_dynar_push_as(links_list,void*,info->link_down); //link_down
/* Creation routing model functions */
AS_t model_cluster_create(void)
{
/* Creation routing model functions */
AS_t model_cluster_create(void)
{
- AS_t result = model_none_create();
+ AS_t result = model_none_create_sized(sizeof(s_as_cluster_t));
result->get_route = cluster_get_route;
result->finalize = model_cluster_finalize;
result->get_route = cluster_get_route;
result->finalize = model_cluster_finalize;
xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
}
xbt_dict_set(cluster_host_link,host_id,info,xbt_free);
}
+
+void surf_routing_cluster_add_backbone(AS_t as, void* bb) {
+ ((as_cluster_t)as)->backbone = bb;
+}
/* ************** Cluster ROUTING **************** */
AS_t model_cluster_create(void); /* create structures for cluster routing model */
/* ************** Cluster ROUTING **************** */
AS_t model_cluster_create(void); /* create structures for cluster routing model */
+/* Pass info from the cluster parser to the cluster routing */
void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info);
void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info);
+void surf_routing_cluster_add_backbone(AS_t as, void* bb);
/* ************************************************** */
/* ************** Vivaldi ROUTING **************** */
/* ************************************************** */
/* ************** Vivaldi ROUTING **************** */