- for (unsigned int it_src = 0; it_src < totalHosts; it_src++) { // Routes from host
- simgrid::s4u::Host* host1 = hosts[it_src];
- simgrid::kernel::routing::NetPoint* netcardSrc = host1->pimpl_netpoint;
- for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
- simgrid::s4u::Host* host2 = hosts[it_dst];
- std::vector<simgrid::surf::LinkImpl*> route;
- simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
- 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->cname());
- std::printf("\n </route>\n");
- }
- }
- for (auto netcardDst : netcardList) { // to router
- if (netcardDst->isRouter()) {
- std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->cname(), netcardDst->cname());
- std::vector<simgrid::surf::LinkImpl*> route;
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, &route, nullptr);
- for (auto link : route)
- std::printf("<link_ctn id=\"%s\"/>", link->cname());
- std::printf("\n </route>\n");
- }
- }
- }