graphNodeMap_ = xbt_dict_new_homogeneous(&graph_node_map_elem_free);
/* Add the loopback if needed */
- if (routing_platf->loopback_ && hierarchy_ == SURF_ROUTING_BASE) {
+ if (routing_platf->loopback_ && hierarchy_ == AsImpl::ROUTING_BASE) {
xbt_dynar_foreach(xbt_graph_get_nodes(routeGraph_), cursor, node) {
xbt_edge_t edge = NULL;
xbt_graph_new_edge(routeGraph_, src, dst, e_route);
}
-xbt_dynar_t AsDijkstra::getOneLinkRoutes()
-{
- xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
- sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t,1);
- route->link_list = new std::vector<Link*>();
-
- int table_size = (int)xbt_dynar_length(vertices_);
- for(int src=0; src < table_size; src++) {
- for(int dst=0; dst< table_size; dst++) {
- route->link_list->clear();
- NetCard *src_elm = xbt_dynar_get_as(vertices_, src, NetCard*);
- NetCard *dst_elm = xbt_dynar_get_as(vertices_, dst, NetCard*);
- this->getRouteAndLatency(src_elm, dst_elm,route, NULL);
-
- if (route->link_list->size() == 1) {
- Link *link = route->link_list->at(0);
- Onelink *onelink;
- if (hierarchy_ == SURF_ROUTING_BASE)
- onelink = new Onelink(link, src_elm, dst_elm);
- else if (hierarchy_ == SURF_ROUTING_RECURSIVE)
- onelink = new Onelink(link, route->gw_src, route->gw_dst);
- else
- onelink = new Onelink(link, NULL, NULL);
- xbt_dynar_push(ret, &onelink);
- }
- }
- }
- return ret;
-}
-
void AsDijkstra::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat)
{
getRouteCheckParams(src, dst);
if (v == dst_node_id)
first_gw = gw_dst;
- if (hierarchy_ == SURF_ROUTING_RECURSIVE && v != dst_node_id && strcmp(gw_dst->name(), prev_gw_src->name())) {
+ if (hierarchy_ == AsImpl::ROUTING_RECURSIVE && v != dst_node_id && strcmp(gw_dst->name(), prev_gw_src->name())) {
std::vector<Link*> *e_route_as_to_as = new std::vector<Link*>();
routing_platf->getRouteAndLatency(gw_dst_net_elm, prev_gw_src_net_elm, e_route_as_to_as, NULL);
size++;
}
- if (hierarchy_ == SURF_ROUTING_RECURSIVE) {
+ if (hierarchy_ == AsImpl::ROUTING_RECURSIVE) {
route->gw_src = gw_src;
route->gw_dst = first_gw;
}