From 02106e5655ec565a71eeeb25034a587808f9ae1f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 25 Mar 2016 11:59:31 +0100 Subject: [PATCH] kill a useless element in the NS3 extension of hosts --- examples/msg/ns3/ns3.tesh | 2 +- src/surf/network_ns3.cpp | 15 +++++---------- src/surf/ns3/ns3_interface.h | 1 - 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/examples/msg/ns3/ns3.tesh b/examples/msg/ns3/ns3.tesh index e4f7fbb702..50c83db585 100644 --- a/examples/msg/ns3/ns3.tesh +++ b/examples/msg/ns3/ns3.tesh @@ -41,8 +41,8 @@ p Dogbone ! timeout 10 $ ns3/ns3 ${srcdir:=.}/examples/platforms/dogbone.xml ${srcdir:=.}/examples/msg/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' -> [C2:slave(4)] [msg_test/INFO] FLOW[1] : Receive 20000000 bytes from S2 to C2 > [C1:slave(3)] [msg_test/INFO] FLOW[0] : Receive 20000000 bytes from S1 to C1 +> [C2:slave(4)] [msg_test/INFO] FLOW[1] : Receive 20000000 bytes from S2 to C2 p 2hosts 1link diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index d9589426aa..475ad6a9ff 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -60,9 +60,7 @@ static void simgrid_ns3_add_host(simgrid::s4u::Host& host) ns3::Ptr node = ns3::CreateObject (0); stack.Install(node); nodes.Add(node); - ns3host->node_num = number_of_nodes; - ns3host->type = NS3_NETWORK_ELEMENT_HOST; - number_of_nodes++; + ns3host->node_num = number_of_nodes ++; host.extension_set(NS3_EXTENSION_ID, ns3host); } @@ -71,8 +69,7 @@ static void simgrid_ns3_add_router(simgrid::surf::NetCard* router) { const char* router_id = router->name(); XBT_DEBUG("NS3_ADD_ROUTER '%s'",router_id); - xbt_lib_set(as_router_lib, router_id, NS3_ASR_LEVEL, ns3_add_router(router_id) - ); + xbt_lib_set(as_router_lib, router_id, NS3_ASR_LEVEL, ns3_add_router(router_id) ); } #include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area @@ -136,8 +133,8 @@ static void parse_ns3_add_cluster(sg_platf_cluster_cbarg_t cluster) xbt_assert(host_src && host_dst, "\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num); - ns3_add_link(host_src->node_num,host_src->type, - host_dst->node_num,host_dst->type, + ns3_add_link(host_src->node_num,NS3_NETWORK_ELEMENT_HOST, + host_dst->node_num,NS3_NETWORK_ELEMENT_HOST, bw,lat); free(router_id); @@ -196,7 +193,7 @@ static void create_ns3_topology(void) if (!host_src || !host_dst) xbt_die("\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num); - ns3_add_link(host_src->node_num,host_src->type,host_dst->node_num,host_dst->type,link_bdw,link_lat); + ns3_add_link(host_src->node_num,NS3_NETWORK_ELEMENT_HOST,host_dst->node_num,NS3_NETWORK_ELEMENT_HOST,link_bdw,link_lat); xbt_free(link_bdw); xbt_free(link_lat); @@ -474,7 +471,6 @@ void * ns3_add_host_cluster(const char * id) Cluster_nodes.Add(node); nodes.Add(node); host->node_num = number_of_nodes; - host->type = NS3_NETWORK_ELEMENT_HOST; number_of_nodes++; return host; } @@ -487,7 +483,6 @@ void * ns3_add_router(const char * id) stack.Install(node); nodes.Add(node); router->node_num = number_of_nodes; - router->type = NS3_NETWORK_ELEMENT_ROUTER; number_of_nodes++; return router; } diff --git a/src/surf/ns3/ns3_interface.h b/src/surf/ns3/ns3_interface.h index b0eb1bbcc2..33ce2eb510 100644 --- a/src/surf/ns3/ns3_interface.h +++ b/src/surf/ns3/ns3_interface.h @@ -31,7 +31,6 @@ typedef enum { typedef struct ns3_node { int node_num; - e_ns3_network_element_type_t type; } s_ns3_node_t, *ns3_node_t; XBT_PUBLIC_DATA(int) NS3_EXTENSION_ID; -- 2.20.1