X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/08d6f4a6c14a89ccd8f1bb4ed638c3cdc5928050..703e8696289393e60554250c2ada4ea97ed89435:/src/surf/surf_routing.cpp diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 5e3b5ed8ae..b196348bc7 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -673,32 +673,29 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster) xbt_dict_set(patterns, "suffix", xbt_strdup(cluster->suffix), NULL); } - /* parse the topology attribute. If we are not in a flat cluster, - * switch to the right mode and initialize the routing with - * the parameters in topo_parameters attribute - */ + /* Parse the topology attributes. + * Nothing to do in a vanilla cluster, but that's another story for torus and flat_trees */ s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER; AS.id = cluster->id; - if(cluster->topology == SURF_CLUSTER_TORUS){ + switch (cluster->topology) { + case SURF_CLUSTER_TORUS: XBT_DEBUG("", cluster->id); AS.routing = A_surfxml_AS_routing_Cluster___torus; - sg_platf_new_AS_begin(&AS); - ((AsClusterTorus*)current_routing)->parse_specific_arguments(cluster); - } - else if (cluster->topology == SURF_CLUSTER_FAT_TREE) { + break; + case SURF_CLUSTER_FAT_TREE: XBT_DEBUG("", cluster->id); AS.routing = A_surfxml_AS_routing_Cluster___fat___tree; - sg_platf_new_AS_begin(&AS); - ((AsClusterFatTree*)current_routing)->parse_specific_arguments(cluster); - } - - else{ + break; + default: XBT_DEBUG("", cluster->id); AS.routing = A_surfxml_AS_routing_Cluster; - sg_platf_new_AS_begin(&AS); + break; } + sg_platf_new_AS_begin(&AS); + static_cast(current_routing)->parse_specific_arguments(cluster); + if(cluster->loopback_bw!=0 || cluster->loopback_lat!=0){ ((AsCluster*)current_routing)->p_nb_links_per_node++; ((AsCluster*)current_routing)->p_has_loopback=1; @@ -710,7 +707,6 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster) } - current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);