From: Bruno Donassolo Date: Mon, 10 May 2021 14:16:42 +0000 (+0200) Subject: Fix NS-3 tests X-Git-Tag: v3.28~293 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/75d183ff7b05ac2788d6ed217054552c0cc20330 Fix NS-3 tests Since cluster zones are now based on star, we cannot keep the checks --- diff --git a/src/kernel/routing/StarZone.cpp b/src/kernel/routing/StarZone.cpp index 3d27937642..724c711e10 100644 --- a/src/kernel/routing/StarZone.cpp +++ b/src/kernel/routing/StarZone.cpp @@ -7,9 +7,6 @@ #include "simgrid/kernel/routing/NetPoint.hpp" #include "simgrid/kernel/routing/RoutedZone.hpp" #include "src/surf/network_interface.hpp" -#if SIMGRID_HAVE_NS3 -#include "src/surf/network_ns3.hpp" -#endif #include "xbt/string.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_star, surf, "Routing part of surf"); @@ -162,10 +159,6 @@ void StarZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoin void StarZone::do_seal() { -#if SIMGRID_HAVE_NS3 - xbt_assert(not dynamic_cast(get_network_model().get()), - "StarZone are not supported by NS-3 right now"); -#endif /* add default empty links if nothing was configured by user */ for (auto const& node : get_vertices()) { auto route = routes_.emplace(node->id(), StarRoute()); diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index f51fd2568c..1180f02b1f 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -232,7 +232,10 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin simgrid::kernel::routing::NetPoint* /*gw_dst*/, std::vector const& link_list) { - xbt_assert(src && dst, "NS-3: add_route, invalid src or destination"); + /* ignoring routes from StarZone, not supported */ + if (not src || not dst) + return; + if (link_list.size() == 1) { auto const* link = static_cast(link_list[0]); diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 8c30f38eae..8add01507a 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -339,6 +339,7 @@ static void sg_platf_new_cluster_flat(simgrid::kernel::routing::ClusterCreationA auto* router = zone->create_router(cluster->router_id); zone->add_route(router, nullptr, nullptr, nullptr, {}); + zone->seal(); simgrid::kernel::routing::on_cluster_creation(*cluster); }