- if (timings) {
- XBT_INFO("Parsing time: %fs (%zu hosts, %d links)", xbt_os_timer_elapsed(parse_time),
- sg_host_count(), sg_link_count());
- } else {
- std::printf("<?xml version='1.0'?>\n");
- std::printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd\">\n");
- std::printf("<platform version=\"%d\">\n", version);
- std::printf("<AS id=\"AS0\" routing=\"Full\">\n");
-
- // Hosts
- unsigned int totalHosts = sg_host_count();
- sg_host_t *hosts = sg_host_list();
- std::qsort((void *) hosts, totalHosts, sizeof(sg_host_t), name_compare_hosts);
-
- for (i = 0; i < totalHosts; i++) {
- std::printf(" <host id=\"%s\" speed=\"%.0f\"", hosts[i]->cname(), sg_host_speed(hosts[i]));
- props = sg_host_get_properties(hosts[i]);
- if (hosts[i]->coreCount()>1) {
- std::printf(" core=\"%d\"", hosts[i]->coreCount());
- }
- if (props && !xbt_dict_is_empty(props)) {
- std::printf(">\n");
- xbt_dict_foreach(props, cursor, key, data) {
- std::printf(" <prop id=\"%s\" value=\"%s\"/>\n", key, data);
- }
- std::printf(" </host>\n");
- } else {
- std::printf("/>\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::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 (not route.empty()) {
+ std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->getCname(), host2->getCname());
+ for (auto const& link : route)
+ std::printf("<link_ctn id=\"%s\"/>", link->getCname());
+ std::printf("\n </route>\n");