Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
NS3: be explicit when ignoring long routes
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 23 May 2017 16:01:54 +0000 (18:01 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 23 May 2017 16:01:54 +0000 (18:01 +0200)
examples/msg/network-ns3/network-ns3.tesh
src/surf/network_ns3.cpp

index 7175037..09e51da 100644 (file)
@@ -41,6 +41,9 @@ p Dogbone
 ! timeout 10
 $ ${bindir:=.}/network-ns3/network-ns3 ${srcdir:=.}/examples/platforms/dogbone.xml ${srcdir:=.}/examples/msg/network-ns3/dogbone_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
 > [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
 ! timeout 10
 $ ${bindir:=.}/network-ns3/network-ns3 ${srcdir:=.}/examples/platforms/dogbone.xml ${srcdir:=.}/examples/msg/network-ns3/dogbone_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
 > [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [:maestro(0)] [ns3/INFO] Ignoring a route between S1 and C1 of length 3: Only routes of length 1 are considered with NS3.
+> You can ignore this warning if your hosts can still communicate when only considering routes of length 1.
+> You may also remove these routes to avoid this harmless message. Other long routes will be silently ignored.
 > [C1:worker(3)] [msg_test/INFO] FLOW[0] : Receive 10000 bytes from S1 to C1
 > [C2:worker(4)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from S2 to C2
 
 > [C1:worker(3)] [msg_test/INFO] FLOW[0] : Receive 10000 bytes from S1 to C1
 > [C2:worker(4)] [msg_test/INFO] FLOW[1] : Receive 10000 bytes from S2 to C2
 
index adf7d54..81f579e 100644 (file)
@@ -90,6 +90,8 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
                              simgrid::kernel::routing::NetPoint* gw_dst,
                              std::vector<simgrid::surf::LinkImpl*>* link_list)
 {
                              simgrid::kernel::routing::NetPoint* gw_dst,
                              std::vector<simgrid::surf::LinkImpl*>* link_list)
 {
+  static bool warned_about_long_routes = false;
+
   if (link_list->size() == 1) {
     simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list->at(0));
 
   if (link_list->size() == 1) {
     simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list->at(0));
 
@@ -114,6 +116,15 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
 
     xbt_free(link_bdw);
     xbt_free(link_lat);
 
     xbt_free(link_bdw);
     xbt_free(link_lat);
+  } else {
+    if (not warned_about_long_routes)
+      XBT_INFO(
+          "Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n"
+          "You can ignore this warning if your hosts can still communicate when only considering routes of length 1.\n"
+          "You may also remove these routes to avoid this harmless message. Other long routes will be silently "
+          "ignored.",
+          src->cname(), dst->cname(), link_list->size());
+    warned_about_long_routes = true;
   }
 }
 
   }
 }