Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix NS-3 tests
authorBruno Donassolo <bruno.donassolo@inria.fr>
Mon, 10 May 2021 14:16:42 +0000 (16:16 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Mon, 10 May 2021 14:16:42 +0000 (16:16 +0200)
Since cluster zones are now based on star, we cannot keep the checks

src/kernel/routing/StarZone.cpp
src/surf/network_ns3.cpp
src/surf/sg_platf.cpp

index 3d27937..724c711 100644 (file)
@@ -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<resource::NetworkNS3Model*>(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());
index f51fd25..1180f02 100644 (file)
@@ -232,7 +232,10 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
                              simgrid::kernel::routing::NetPoint* /*gw_dst*/,
                              std::vector<simgrid::kernel::resource::LinkImpl*> 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<simgrid::kernel::resource::LinkNS3*>(link_list[0]);
 
index 8c30f38..8add015 100644 (file)
@@ -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);
 }