X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/25137bd6bc44e1260223b141b46cedd6e7ef1da0..66a6b6eefde8b9d5aac551b3e0008d3df3ddeba7:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index e013c5c102..65abb38f6f 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -127,7 +127,8 @@ static double base_vivaldi_get_latency (const char *src, const char *dst) xbt_assert(euclidean_dist>=0, "Euclidean Dist is less than 0\"%s\" and \"%.2f\"", src, euclidean_dist); - return euclidean_dist; + //From .ms to .s + return euclidean_dist / 1000; } static double vivaldi_get_link_latency (routing_component_t rc,const char *src, const char *dst, route_extended_t e_route) @@ -610,14 +611,14 @@ static void elements_father(const char *src, const char *dst, /* (2) find the path to the root routing component */ for (current = src_as ; current != NULL ; current = current->routing_father) { + if (index_src >= ELEMENTS_FATHER_MAXDEPTH) + xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_src"); path_src[index_src++] = current; - xbt_assert(index_src <= ELEMENTS_FATHER_MAXDEPTH, - "ELEMENTS_FATHER_MAXDEPTH should be increased for path_src"); } for (current = dst_as ; current != NULL ; current = current->routing_father) { + if (index_dst >= ELEMENTS_FATHER_MAXDEPTH) + xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst"); path_dst[index_dst++] = current; - xbt_assert(index_dst <= ELEMENTS_FATHER_MAXDEPTH, - "ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst"); } /* (3) find the common father */ @@ -1179,9 +1180,8 @@ route_extended_t generic_get_bypassroute(routing_component_t rc, current_src = xbt_dynar_get_ptr(path_src, index_src); current_dst = xbt_dynar_get_ptr(path_dst, index_dst); while (index_src >= 0 && index_dst >= 0 && *current_src == *current_dst) { - routing_component_t *tmp_src, *tmp_dst; - tmp_src = xbt_dynar_pop_ptr(path_src); - tmp_dst = xbt_dynar_pop_ptr(path_dst); + xbt_dynar_pop_ptr(path_src); + xbt_dynar_pop_ptr(path_dst); index_src--; index_dst--; current_src = xbt_dynar_get_ptr(path_src, index_src);