X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8e70d54a095cd7779a53c7a164f775f7a37b29e5..HEAD:/src/kernel/routing/NetZoneImpl.cpp diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index cb9ca40e87..08df429aca 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -9,7 +9,6 @@ #include #include -#include "src/include/simgrid/sg_config.hpp" #include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/CpuImpl.hpp" #include "src/kernel/resource/DiskImpl.hpp" @@ -19,6 +18,7 @@ #include "src/kernel/resource/StandardLinkImpl.hpp" #include "src/kernel/resource/VirtualMachineImpl.hpp" #include "src/simgrid/module.hpp" +#include "src/simgrid/sg_config.hpp" #include "xbt/asserts.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_platform, kernel, "Kernel platform-related information"); @@ -595,7 +595,7 @@ void NetZoneImpl::get_global_route_with_netzones(const NetPoint* src, const NetP return; /* If src and dst are in the same netzone, life is good */ - if (src_ancestor == dst_ancestor) { /* SURF_ROUTING_BASE */ + if (src_ancestor == dst_ancestor) { /* ROUTING_BASE */ route.link_list_ = std::move(links); common_ancestor->get_local_route(src, dst, &route, latency); links = std::move(route.link_list_); @@ -622,8 +622,8 @@ void NetZoneImpl::get_graph(const s_xbt_graph_t* graph, std::map vertices = get_vertices(); - for (auto const& my_src : vertices) { - for (auto const& my_dst : vertices) { + for (auto const* my_src : vertices) { + for (auto const* my_dst : vertices) { if (my_src == my_dst) continue; @@ -669,6 +669,24 @@ void NetZoneImpl::get_graph(const s_xbt_graph_t* graph, std::mapsecond; +} + void NetZoneImpl::seal() { /* already sealed netzone */ @@ -676,6 +694,10 @@ void NetZoneImpl::seal() return; do_seal(); // derived class' specific sealing procedure + // for zone with a single host, this host is its own default gateway + if (gateways_.empty() && hosts_.size() == 1) + gateways_["default"] = hosts_.begin()->second->get_iface()->get_netpoint(); + /* seals sub-netzones and hosts */ for (auto* host : get_all_hosts()) { host->seal();