From: Navarrop Date: Mon, 18 Jul 2011 10:46:49 +0000 (+0200) Subject: We can use the cluster tag without backbone link if bb_bw and bb_lat attributes are... X-Git-Tag: v3_6_2~190^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fd3a39be50eb5857aa79028589e7476992913307?hp=769248f32027ad47882557bf1fe8a64eab14f483 We can use the cluster tag without backbone link if bb_bw and bb_lat attributes are not used. See One_cluster.xml and One_cluster_no_backbone.xml for examples. --- diff --git a/examples/platforms/One_cluster.xml b/examples/platforms/One_cluster.xml index 6b4354dcea..a638eae8f3 100644 --- a/examples/platforms/One_cluster.xml +++ b/examples/platforms/One_cluster.xml @@ -1,5 +1,15 @@ + + + + + + + + + + diff --git a/src/surf/simgrid.dtd b/src/surf/simgrid.dtd index b833698a21..83cc58ec30 100644 --- a/src/surf/simgrid.dtd +++ b/src/surf/simgrid.dtd @@ -50,8 +50,8 @@ - - + + diff --git a/src/surf/simgrid_dtd.c b/src/surf/simgrid_dtd.c index fda8136ba2..ad68b8b31c 100644 --- a/src/surf/simgrid_dtd.c +++ b/src/surf/simgrid_dtd.c @@ -5183,8 +5183,6 @@ YY_RULE_SETUP if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element."); if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element."); if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element."); - if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element."); - if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element."); LEAVE; STag_surfxml_cluster();surfxml_pcdata_ix = 0; ENTER(E_surfxml_cluster); } YY_BREAK @@ -5198,8 +5196,6 @@ YY_RULE_SETUP if (!AX_surfxml_cluster_power) FAIL("Required attribute `power' not set for `cluster' element."); if (!AX_surfxml_cluster_bw) FAIL("Required attribute `bw' not set for `cluster' element."); if (!AX_surfxml_cluster_lat) FAIL("Required attribute `lat' not set for `cluster' element."); - if (!AX_surfxml_cluster_bb_bw) FAIL("Required attribute `bb_bw' not set for `cluster' element."); - if (!AX_surfxml_cluster_bb_lat) FAIL("Required attribute `bb_lat' not set for `cluster' element."); LEAVE; STag_surfxml_cluster(); surfxml_pcdata_ix = 0; ETag_surfxml_cluster(); popbuffer(); /* attribute */ switch (YY_START) { case S_surfxml_AS_2: case S_surfxml_AS: case S_surfxml_AS_3: SET(S_surfxml_AS_3); break; diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 65abb38f6f..42d1eac6fa 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1689,8 +1689,6 @@ void routing_parse_Scluster(void) router_id = bprintf("%s%s_router%s", cluster_prefix, cluster_id, cluster_suffix); - //link_router = bprintf("%s_link_%s_router", cluster_id, cluster_id); - link_backbone = bprintf("%s_backbone", cluster_id); XBT_DEBUG("", router_id); SURFXML_BUFFER_SET(router_id, router_id); @@ -1698,31 +1696,8 @@ void routing_parse_Scluster(void) SURFXML_START_TAG(router); SURFXML_END_TAG(router); - //TODO -// xbt_dict_set(patterns, "radical", xbt_strdup("_router"), xbt_free); -// temp_cluster_bw = xbt_strdup(cluster_bw); -// temp_cluster_bw = replace_random_parameter(temp_cluster_bw); -// temp_cluster_lat = xbt_strdup(cluster_lat); -// temp_cluster_lat = replace_random_parameter(temp_cluster_lat); -// XBT_DEBUG("", link_router,temp_cluster_bw, temp_cluster_lat); -// A_surfxml_link_state = A_surfxml_link_state_ON; -// A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED; -// if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FULLDUPLEX) -// {A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FULLDUPLEX;} -// if(cluster_sharing_policy == A_surfxml_cluster_sharing_policy_FATPIPE) -// {A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;} -// SURFXML_BUFFER_SET(link_id, link_router); -// SURFXML_BUFFER_SET(link_bandwidth, temp_cluster_bw); -// SURFXML_BUFFER_SET(link_latency, temp_cluster_lat); -// SURFXML_BUFFER_SET(link_bandwidth_file, ""); -// SURFXML_BUFFER_SET(link_latency_file, ""); -// SURFXML_BUFFER_SET(link_state_file, ""); -// SURFXML_START_TAG(link); -// SURFXML_END_TAG(link); - -// xbt_free(temp_cluster_bw); -// xbt_free(temp_cluster_lat); - + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){ + link_backbone = bprintf("%s_backbone", cluster_id); XBT_DEBUG("", link_backbone,cluster_bb_bw, cluster_bb_lat); A_surfxml_link_state = A_surfxml_link_state_ON; A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_SHARED; @@ -1736,6 +1711,7 @@ void routing_parse_Scluster(void) SURFXML_BUFFER_SET(link_state_file, ""); SURFXML_START_TAG(link); SURFXML_END_TAG(link); + } XBT_DEBUG(" "); @@ -1766,11 +1742,13 @@ void routing_parse_Scluster(void) A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO; SURFXML_START_TAG(route); + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){ XBT_DEBUG("", pcre_link_backbone); SURFXML_BUFFER_SET(link_ctn_id, pcre_link_backbone); A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE; SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + } XBT_DEBUG(""); SURFXML_END_TAG(route); @@ -1791,11 +1769,13 @@ void routing_parse_Scluster(void) SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){ XBT_DEBUG("", pcre_link_backbone); SURFXML_BUFFER_SET(link_ctn_id, pcre_link_backbone); A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE; SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + } XBT_DEBUG(""); SURFXML_END_TAG(route); @@ -1808,11 +1788,13 @@ void routing_parse_Scluster(void) A_surfxml_route_symmetrical = A_surfxml_route_symmetrical_NO; SURFXML_START_TAG(route); + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){ XBT_DEBUG("", pcre_link_backbone); SURFXML_BUFFER_SET(link_ctn_id, pcre_link_backbone); A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE; SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + } XBT_DEBUG("", pcre_link_dst); SURFXML_BUFFER_SET(link_ctn_id, pcre_link_dst); @@ -1841,11 +1823,13 @@ void routing_parse_Scluster(void) SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){ XBT_DEBUG("", pcre_link_backbone); SURFXML_BUFFER_SET(link_ctn_id, pcre_link_backbone); A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE; SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + } XBT_DEBUG("", pcre_link_dst); SURFXML_BUFFER_SET(link_ctn_id, pcre_link_dst); @@ -1862,6 +1846,7 @@ void routing_parse_Scluster(void) free(pcre_link_backbone); free(pcre_link_src); free(route_src_dst); + #else for (i = 0; i <= xbt_dynar_length(tab_elements_num); i++) { for (j = 0; j <= xbt_dynar_length(tab_elements_num); j++) { @@ -1904,11 +1889,13 @@ void routing_parse_Scluster(void) free(route_src); } + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")){ XBT_DEBUG("", cluster_id); SURFXML_BUFFER_SET(link_ctn_id, bprintf("%s_backbone", cluster_id)); A_surfxml_link_ctn_direction = A_surfxml_link_ctn_direction_NONE; SURFXML_START_TAG(link_ctn); SURFXML_END_TAG(link_ctn); + } if (j != xbt_dynar_length(tab_elements_num)) { route_dst = @@ -1933,8 +1920,8 @@ void routing_parse_Scluster(void) #endif free(router_id); - free(link_backbone); - //free(link_router); + if(strcmp(cluster_bb_bw,"") && strcmp(cluster_bb_lat,"")) + free(link_backbone); xbt_dict_free(&patterns); free(availability_file); free(state_file);