- sg_host_t host1, host2;
- xbt_dict_foreach(host_list, cursor_src, src, host1){ // Routes from host
- value1 = sg_host_by_name(src)->pimpl_netcard;
- xbt_dict_foreach(host_list, cursor_dst, dst, host2){ //to host
- std::vector<Link*> *route = new std::vector<Link*>();
- value2 = sg_host_by_name(dst)->pimpl_netcard;
- routing_platf->getRouteAndLatency(value1, value2, route,NULL);
- if (! route->empty()){
- printf(" <route src=\"%s\" dst=\"%s\">\n ", src, dst);
- for (auto link: *route)
- printf("<%s id=\"%s\"/>",link_ctn,link->getName());
- printf("\n </route>\n");
+ for (unsigned int it_src = 0; it_src < totalHosts; it_src++) { // Routes from host
+ simgrid::s4u::Host* host1 = hosts[it_src];
+ simgrid::kernel::routing::NetCard* netcardSrc = host1->pimpl_netcard;
+ for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
+ simgrid::s4u::Host* host2 = hosts[it_dst];
+ std::vector<Link*> route;
+ simgrid::kernel::routing::NetCard* netcardDst = host2->pimpl_netcard;
+ simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, &route, nullptr);
+ if (!route.empty()) {
+ std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->cname(), host2->cname());
+ for (auto link : route)
+ std::printf("<link_ctn id=\"%s\"/>",link->getName());
+ std::printf("\n </route>\n");