From 931e26e928ecd6de21bd1450de7ac17a9780cbd4 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 25 Jan 2016 23:25:24 +0100 Subject: [PATCH] body count++: routing_get_latency_and_bandwidth --- src/instr/instr_interface.cpp | 3 ++- src/surf/network_ns3.cpp | 5 ++--- src/surf/surf_c_bindings.cpp | 5 ----- src/surf/surf_private.h | 4 ---- src/surf/surf_routing.cpp | 2 +- src/surf/surf_routing_floyd.cpp | 2 +- teshsuite/simdag/platforms/flatifier.cpp | 10 +++++----- 7 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 290bd88a71..84d70e6a78 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -6,6 +6,7 @@ #include "simgrid_config.h" +#include "src/surf/network_interface.hpp" #include "src/instr/instr_private.h" #include "surf/surf.h" #include "src/surf/surf_private.h" @@ -370,7 +371,7 @@ static void instr_user_srcdst_variable(double time, sg_netcard_t dst_elm = sg_netcard_by_name_or_null(dst); if(!dst_elm) xbt_die("Element '%s' not found!",dst); - routing_get_route_and_latency (src_elm, dst_elm, &route,NULL); + routing_platf->getRouteAndLatency (src_elm, dst_elm, &route,NULL); unsigned int i; surf_cpp_resource_t link; xbt_dynar_foreach (route, i, link) { diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 7a62ae1ce9..fd34a63232 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -307,8 +307,7 @@ Link* NetworkNS3Model::createLink(const char *name, xbt_dynar_t NetworkNS3Model::getRoute(NetCard *src, NetCard *dst) { xbt_dynar_t route = NULL; - routing_get_route_and_latency(src, dst, &route, NULL); - //routing_platf->getRouteAndLatency(src, dst, &route, NULL); + routing_platf->getRouteAndLatency(src, dst, &route, NULL); return route; } @@ -379,7 +378,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta) xbt_dynar_t route = NULL; - routing_get_route_and_latency (action->p_srcElm, action->p_dstElm, &route, NULL); + routing_platf->getRouteAndLatency (action->p_srcElm, action->p_dstElm, &route, NULL); unsigned int i; for (i = 0; i < xbt_dynar_length (route); i++){ NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i)); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index ea95db4dbb..ce621b9630 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -158,11 +158,6 @@ double surf_solve(double max_date) return surf_min; } -void routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst, - xbt_dynar_t * route, double *latency){ - routing_platf->getRouteAndLatency(src, dst, route, latency); -} - /********* * MODEL * *********/ diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index fd5d0c18c2..aaa141e1e1 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -76,10 +76,6 @@ XBT_PUBLIC(void) routing_register_callbacks(void); XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free // FIXME: make previous function private to routing again? - -XBT_PUBLIC(void) routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst, - xbt_dynar_t * route, double *latency); - XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc); /** * Resource protected methods diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index c3178459f7..f5cb8aa15c 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -542,7 +542,7 @@ namespace surf { */ void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, xbt_dynar_t* route, double *latency) { - XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName()); + XBT_DEBUG("getRouteAndLatency from %s to %s", src->getName(), dst->getName()); if (NULL == *route) { xbt_dynar_reset(routing_platf->p_lastRoute); *route = routing_platf->p_lastRoute; diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index b8674c0a42..2ece750ad6 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -120,7 +120,7 @@ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbar if (p_hierarchy == SURF_ROUTING_RECURSIVE && prev_dst_gw != NULL && strcmp(prev_dst_gw->getName(), e_route->gw_src->getName())) { - routing_get_route_and_latency(prev_dst_gw, e_route->gw_src, + routing_platf->getRouteAndLatency(prev_dst_gw, e_route->gw_src, &res->link_list, lat); } diff --git a/teshsuite/simdag/platforms/flatifier.cpp b/teshsuite/simdag/platforms/flatifier.cpp index 28c340feda..a2178440ec 100644 --- a/teshsuite/simdag/platforms/flatifier.cpp +++ b/teshsuite/simdag/platforms/flatifier.cpp @@ -14,7 +14,7 @@ #include #include - +#include "src/surf/network_interface.hpp" #include "simgrid/simdag.h" #include "xbt/log.h" #include "xbt/dict.h" @@ -202,7 +202,7 @@ int main(int argc, char **argv) ,dst); xbt_dynar_t route=NULL; value2 = sg_host_by_name(dst)->pimpl_netcard; - routing_get_route_and_latency(value1, value2, &route,NULL); + routing_platf->getRouteAndLatency(value1, value2, &route,NULL); for(i=0;igetRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL); for(i=0;igetRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL); for(i=0;ipimpl_netcard; - routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL); + routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL); for(i=0;i