From 9575359fcebd3a393b65891c293990d1a882eb34 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 23 May 2017 19:08:22 +0200 Subject: [PATCH] useless cosmetics around NS3 long routes --- examples/msg/network-ns3/network-ns3.tesh | 6 +++--- src/surf/network_ns3.cpp | 16 ++++++++-------- src/surf/network_ns3.hpp | 7 +++---- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/examples/msg/network-ns3/network-ns3.tesh b/examples/msg/network-ns3/network-ns3.tesh index 09e51da84e..56410a0f11 100644 --- a/examples/msg/network-ns3/network-ns3.tesh +++ b/examples/msg/network-ns3/network-ns3.tesh @@ -41,9 +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' -> [: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. +> [:maestro(0)] [ns3/WARNING] Ignoring a route between S1 and C1 of length 3: Only routes of length 1 are considered with NS3. +> WARNING: You can ignore this warning if your hosts can still communicate when only considering routes of length 1. +> WARNING: Remove long routes to avoid this harmless message; subsequent 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 diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index a343a7a498..937f4e9a5a 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -90,8 +90,6 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin simgrid::kernel::routing::NetPoint* gw_dst, std::vector* link_list) { - static bool warned_about_long_routes = false; - if (link_list->size() == 1) { simgrid::surf::LinkNS3* link = static_cast(link_list->at(0)); @@ -117,13 +115,15 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin xbt_free(link_bdw); xbt_free(link_lat); } else { + static bool warned_about_long_routes = false; + 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()); + XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n" + "WARNING: You can ignore this warning if your hosts can still communicate when only considering routes " + "of length 1.\n" + "WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently " + "ignored.", + src->cname(), dst->cname(), link_list->size()); warned_about_long_routes = true; } } diff --git a/src/surf/network_ns3.hpp b/src/surf/network_ns3.hpp index ecdb950492..40a49d6067 100644 --- a/src/surf/network_ns3.hpp +++ b/src/surf/network_ns3.hpp @@ -1,13 +1,12 @@ -/* Copyright (c) 2004-2015. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2004-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ + #ifndef NETWORK_NS3_HPP_ #define NETWORK_NS3_HPP_ - -#include +#include "xbt/base.h" #include "network_interface.hpp" #include "src/surf/ns3/ns3_interface.h" -- 2.20.1