X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3432ea9894c66b049be0b2ad1465d3677e739e19..3736e0252d96679e19cfbe41f3c09833d3734386:/src/surf/network.c diff --git a/src/surf/network.c b/src/surf/network.c index d62882504b..9abdaf3ab9 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -81,7 +81,7 @@ static void gap_remove(surf_action_network_CM02_t action) { if(size == 0) { xbt_fifo_free(fifo); xbt_dict_remove(gap_lookup, action->sender.link_name); - size = xbt_dict_size(gap_lookup); + size = xbt_dict_length(gap_lookup); if(size == 0) { xbt_dict_free(&gap_lookup); } @@ -413,7 +413,8 @@ static void net_update_actions_state(double now, double delta) } #ifdef HAVE_TRACING if (TRACE_is_enabled()) { - xbt_dynar_t route = routing_get_route(action->src_name, action->dst_name); + xbt_dynar_t route=NULL; + routing_get_route_and_latency(action->src_name, action->dst_name,&route,NULL); link_CM02_t link; unsigned int i; xbt_dynar_foreach(route, i, link) { @@ -584,12 +585,13 @@ static surf_action_t net_communicate(const char *src_name, xbt_dynar_t back_route = NULL; int constraints_per_variable = 0; - xbt_dynar_t route; - // I need to have the forward and backward routes at the same time, so I don't ask the routing to cleanup the route right away for me - routing_get_route_and_latency(src_name, dst_name, &route, &latency, 0); + xbt_dynar_t route = xbt_dynar_new(sizeof(void*),NULL); + // I need to have the forward and backward routes at the same time, so allocate "route". That way, the routing wont clean it up + routing_get_route_and_latency(src_name, dst_name, &route, &latency); if (sg_network_fullduplex == 1) { - back_route = routing_get_route(dst_name, src_name); + // FIXME: fill route directly + routing_get_route_and_latency(dst_name, src_name, &back_route,NULL); } /* LARGE PLATFORMS HACK: @@ -598,7 +600,7 @@ static surf_action_t net_communicate(const char *src_name, XBT_IN("(%s,%s,%g,%g)", src_name, dst_name, size, rate); /* LARGE PLATFORMS HACK: assert on total_route_size */ - xbt_assert(xbt_dynar_length(route) || latency, + xbt_assert(!xbt_dynar_is_empty(route) || latency, "You're trying to send data from %s to %s but there is no connection at all between these two hosts.", src_name, dst_name); @@ -644,7 +646,7 @@ static surf_action_t net_communicate(const char *src_name, bandwidth_constraint_callback(action->rate, bandwidth_bound, size); - if(xbt_dynar_length(route) > 0) { + if(!xbt_dynar_is_empty(route)) { link = *(link_CM02_t*)xbt_dynar_get_ptr(route, 0); gap_append(size, link, action); XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)", @@ -722,7 +724,9 @@ static surf_action_t net_communicate(const char *src_name, static xbt_dynar_t net_get_route(const char *src, const char *dst) { - return routing_get_route(src, dst); + xbt_dynar_t route=NULL; + routing_get_route_and_latency(src, dst,&route, NULL); + return route; } static double net_get_link_bandwidth(const void *link)