* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "surf_routing_floyd.hpp"
-#include "network_interface.hpp"
+#include "src/surf/surf_routing_private.hpp"
+#include "src/surf/surf_routing_floyd.hpp"
+#include "src/surf/network_interface.hpp"
sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
int src,dst;
sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
int src,dst;
int table_size = xbt_dynar_length(p_indexNetworkElm);
for(src=0; src < table_size; src++) {
for(dst=0; dst< table_size; dst++) {
xbt_dynar_reset(route->link_list);
int table_size = xbt_dynar_length(p_indexNetworkElm);
for(src=0; src < table_size; src++) {
for(dst=0; dst< table_size; dst++) {
xbt_dynar_reset(route->link_list);
- src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdgePtr);
- dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdgePtr);
+ src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*);
+ dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*);
this->getRouteAndLatency(src_elm, dst_elm, route, NULL);
if (xbt_dynar_length(route->link_list) == 1) {
void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
this->getRouteAndLatency(src_elm, dst_elm, route, NULL);
if (xbt_dynar_length(route->link_list) == 1) {
void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
if (p_hierarchy == SURF_ROUTING_BASE)
onelink = new Onelink(link, src_elm, dst_elm);
else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
if (p_hierarchy == SURF_ROUTING_BASE)
onelink = new Onelink(link, src_elm, dst_elm);
else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
-void AsFloyd::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t res, double *lat)
+void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t res, double *lat)
while (!xbt_dynar_is_empty(route_stack)) {
sg_platf_route_cbarg_t e_route = xbt_dynar_pop_as(route_stack, sg_platf_route_cbarg_t);
xbt_dynar_t links;
while (!xbt_dynar_is_empty(route_stack)) {
sg_platf_route_cbarg_t e_route = xbt_dynar_pop_as(route_stack, sg_platf_route_cbarg_t);
xbt_dynar_t links;
xbt_dynar_foreach(links, cpt, link) {
xbt_dynar_push_as(res->link_list, sg_routing_link_t, link);
if (lat)
xbt_dynar_foreach(links, cpt, link) {
xbt_dynar_push_as(res->link_list, sg_routing_link_t, link);
if (lat)
- src_net_elm = sg_routing_edge_by_name_or_null(src);
- dst_net_elm = sg_routing_edge_by_name_or_null(dst);
+ src_net_elm = sg_netcard_by_name_or_null(src);
+ dst_net_elm = sg_netcard_by_name_or_null(dst);
xbt_assert(src_net_elm, "Network elements %s not found", src);
xbt_assert(dst_net_elm, "Network elements %s not found", dst);
xbt_assert(src_net_elm, "Network elements %s not found", src);
xbt_assert(dst_net_elm, "Network elements %s not found", dst);
xbt_dynar_t link_route_to_test = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
xbt_dynar_foreach(route->link_list,cpt,link_name)
{
xbt_dynar_t link_route_to_test = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
xbt_dynar_foreach(route->link_list,cpt,link_name)
{
xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
for(i=xbt_dynar_length(route->link_list) ;i>0 ;i--)
{
link_name = xbt_dynar_get_as(route->link_list,i-1,char *);
for(i=xbt_dynar_length(route->link_list) ;i>0 ;i--)
{
link_name = xbt_dynar_get_as(route->link_list,i-1,char *);
xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}
xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
xbt_dynar_push(link_route_to_test,&link);
}