X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e64ead1c56281b590f80a1eb71d974e76434f0ee..f06041cf2c450457a0b47a49b66b19cb9133c18e:/src/surf/surf_routing.cpp diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index f31b64083c..3193ec3d0c 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -43,7 +43,6 @@ int NS3_HOST_LEVEL; //host node for ns3 xbt_lib_t link_lib; int SD_LINK_LEVEL; //Simdag level int SURF_LINK_LEVEL; //Surf level -int NS3_LINK_LEVEL; //link for ns3 xbt_lib_t as_router_lib; int ROUTING_ASR_LEVEL; //Routing level @@ -360,7 +359,7 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS) switch(AS->routing){ case A_surfxml_AS_routing_Cluster: model = &routing_models[SURF_MODEL_CLUSTER];break; case A_surfxml_AS_routing_Cluster___torus: model = &routing_models[SURF_MODEL_TORUS_CLUSTER];break; - case A_surfxml_AS_routing_Cluster___fat___tree: model = &routing_models[SURF_MODEL_FAT_TREE_CLUSTER]; break; + case A_surfxml_AS_routing_Cluster___fat___tree: model = &routing_models[SURF_MODEL_FAT_TREE_CLUSTER];break; case A_surfxml_AS_routing_Dijkstra: model = &routing_models[SURF_MODEL_DIJKSTRA];break; case A_surfxml_AS_routing_DijkstraCache: model = &routing_models[SURF_MODEL_DIJKSTRACACHE];break; case A_surfxml_AS_routing_Floyd: model = &routing_models[SURF_MODEL_FLOYD];break; @@ -634,7 +633,7 @@ xbt_dynar_t RoutingPlatf::getOneLinkRoutes(){ xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(AsPtr rc) { - xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free); + xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f); //adding my one link routes xbt_dynar_t onelink_mine = rc->getOneLinkRoutes(); @@ -846,7 +845,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster) sg_platf_new_AS_begin(&AS); ((AsClusterFatTree*)current_routing)->parse_specific_arguments(cluster); } - + else{ XBT_DEBUG("", cluster->id); AS.routing = A_surfxml_AS_routing_Cluster; @@ -895,6 +894,15 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster) memset(&host, 0, sizeof(host)); host.id = host_id; + if ((cluster->properties != NULL) && (!xbt_dict_is_empty(cluster->properties))) { + xbt_dict_cursor_t cursor=NULL; + char *key,*data; + host.properties = xbt_dict_new(); + + xbt_dict_foreach(cluster->properties,cursor,key,data) { + xbt_dict_set(host.properties, key, xbt_strdup(data),free); + } + } if (cluster->availability_trace && strcmp(cluster->availability_trace, "")) { xbt_dict_set(patterns, "radical", bprintf("%d", i), NULL); char *avail_file = xbt_str_varsubst(cluster->availability_trace, patterns); @@ -913,7 +921,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster) } else { XBT_DEBUG("\tstate_file=\"\""); } - + xbt_dynar_t power_state_list = xbt_dynar_new(sizeof(double), NULL); xbt_dynar_push(power_state_list,&cluster->power); host.power_peak = power_state_list; @@ -987,7 +995,7 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster) //call the cluster function that adds the others links if (cluster->topology == SURF_CLUSTER_FAT_TREE) { - ((AsClusterFatTree*) current_routing)->addComputeNode(i); + ((AsClusterFatTree*) current_routing)->addProcessingNode(i); } else { ((AsClusterPtr)current_routing)->create_links_for_node(cluster, i, rankId, rankId* @@ -1003,10 +1011,10 @@ static void routing_parse_cluster(sg_platf_cluster_cbarg_t cluster) xbt_dynar_free(&radical_ends); } xbt_dynar_free(&radical_elements); - + // For fat trees, the links must be created once all nodes have been added if(cluster->topology == SURF_CLUSTER_FAT_TREE) { - ((AsClusterFatTree*)current_routing)->create_links(cluster); + ((AsClusterFatTree*)current_routing)->create_links(); } // Add a router. It is magically used thanks to the way in which surf_routing_cluster is written, // and it's very useful to connect clusters together @@ -1299,9 +1307,7 @@ void routing_register_callbacks() sg_platf_trace_add_cb(routing_parse_trace); sg_platf_trace_connect_add_cb(routing_parse_trace_connect); -#ifdef HAVE_TRACING instr_routing_define_callbacks(); -#endif } /**