Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move the ns3 helper files to kernel/models/ns3
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 18 Feb 2023 17:23:50 +0000 (18:23 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 18 Feb 2023 17:24:33 +0000 (18:24 +0100)
MANIFEST.in
src/kernel/resource/models/network_ns3.cpp
src/kernel/resource/models/ns3/ns3_simulator.cpp [moved from src/surf/ns3/ns3_simulator.cpp with 94% similarity]
src/kernel/resource/models/ns3/ns3_simulator.hpp [moved from src/surf/ns3/ns3_simulator.hpp with 100% similarity]
tools/cmake/DefinePackages.cmake
tools/cmake/Flags.cmake

index 47e097b..ff0a062 100644 (file)
@@ -628,8 +628,18 @@ include teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.cpp
 include teshsuite/models/cm02-set-lat-bw/cm02-set-lat-bw.tesh
 include teshsuite/models/cm02-tcpgamma/cm02-tcpgamma.cpp
 include teshsuite/models/cm02-tcpgamma/cm02-tcpgamma.tesh
+include teshsuite/models/core_usage/core_usage.cpp
+include teshsuite/models/core_usage/core_usage.tesh
+include teshsuite/models/core_usage2/core_usage2.cpp
+include teshsuite/models/core_usage2/core_usage2.tesh
 include teshsuite/models/issue105/issue105.cpp
 include teshsuite/models/issue105/issue105.tesh
+include teshsuite/models/lmm_usage/lmm_usage.cpp
+include teshsuite/models/lmm_usage/lmm_usage.tesh
+include teshsuite/models/maxmin_bench/maxmin_bench.cpp
+include teshsuite/models/maxmin_bench/maxmin_bench_large.tesh
+include teshsuite/models/maxmin_bench/maxmin_bench_medium.tesh
+include teshsuite/models/maxmin_bench/maxmin_bench_small.tesh
 include teshsuite/models/ptask-subflows/ptask-subflows.cpp
 include teshsuite/models/ptask-subflows/ptask-subflows.tesh
 include teshsuite/models/ptask_L07_usage/ptask_L07_usage.cpp
@@ -1545,16 +1555,6 @@ include teshsuite/smpi/type-struct/type-struct.c
 include teshsuite/smpi/type-struct/type-struct.tesh
 include teshsuite/smpi/type-vector/type-vector.c
 include teshsuite/smpi/type-vector/type-vector.tesh
-include teshsuite/surf/lmm_usage/lmm_usage.cpp
-include teshsuite/surf/lmm_usage/lmm_usage.tesh
-include teshsuite/surf/maxmin_bench/maxmin_bench.cpp
-include teshsuite/surf/maxmin_bench/maxmin_bench_large.tesh
-include teshsuite/surf/maxmin_bench/maxmin_bench_medium.tesh
-include teshsuite/surf/maxmin_bench/maxmin_bench_small.tesh
-include teshsuite/surf/surf_usage/surf_usage.cpp
-include teshsuite/surf/surf_usage/surf_usage.tesh
-include teshsuite/surf/surf_usage2/surf_usage2.cpp
-include teshsuite/surf/surf_usage2/surf_usage2.tesh
 include teshsuite/xbt/cmdline/cmdline.c
 include teshsuite/xbt/cmdline/cmdline.tesh
 include teshsuite/xbt/log_large/log_large.c
@@ -2089,6 +2089,8 @@ include src/kernel/resource/models/network_ib.cpp
 include src/kernel/resource/models/network_ib.hpp
 include src/kernel/resource/models/network_ns3.cpp
 include src/kernel/resource/models/network_ns3.hpp
+include src/kernel/resource/models/ns3/ns3_simulator.cpp
+include src/kernel/resource/models/ns3/ns3_simulator.hpp
 include src/kernel/resource/models/ptask_L07.cpp
 include src/kernel/resource/models/ptask_L07.hpp
 include src/kernel/resource/profile/Event.hpp
@@ -2433,8 +2435,6 @@ include src/smpi/smpitools.sh
 include src/sthread/sthread.c
 include src/sthread/sthread.h
 include src/sthread/sthread_impl.cpp
-include src/surf/ns3/ns3_simulator.cpp
-include src/surf/ns3/ns3_simulator.hpp
 include src/surf/sg_platf.cpp
 include src/surf/surf_interface.hpp
 include src/surf/xml/platf.hpp
@@ -2541,7 +2541,6 @@ include teshsuite/smpi/mpich3-test/perf/CMakeLists.txt
 include teshsuite/smpi/mpich3-test/pt2pt/CMakeLists.txt
 include teshsuite/smpi/mpich3-test/rma/CMakeLists.txt
 include teshsuite/smpi/mpich3-test/topo/CMakeLists.txt
-include teshsuite/surf/CMakeLists.txt
 include teshsuite/xbt/CMakeLists.txt
 include tools/CMakeLists.txt
 include tools/cmake/CTestConfig.cmake
index 238218a..b486ec1 100644 (file)
@@ -29,7 +29,7 @@
 #include "ns3/wifi-module.h"
 
 #include "network_ns3.hpp"
-#include "src/surf/ns3/ns3_simulator.hpp"
+#include "src/kernel/resource/models/ns3/ns3_simulator.hpp"
 
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
similarity index 94%
rename from src/surf/ns3/ns3_simulator.cpp
rename to src/kernel/resource/models/ns3/ns3_simulator.cpp
index c4b3b5e..0c13eab 100644 (file)
@@ -3,16 +3,17 @@
 /* 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. */
 
-#include "src/surf/ns3/ns3_simulator.hpp"
+#include "src/kernel/resource/models/ns3/ns3_simulator.hpp"
+
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 
-#include <ns3/ipv4-address-helper.h>
-#include <ns3/point-to-point-helper.h>
 #include <ns3/application-container.h>
-#include <ns3/ptr.h>
 #include <ns3/callback.h>
+#include <ns3/ipv4-address-helper.h>
 #include <ns3/packet-sink.h>
+#include <ns3/point-to-point-helper.h>
+#include <ns3/ptr.h>
 
 #include <algorithm>
 
@@ -56,7 +57,7 @@ static void receive_callback(ns3::Ptr<ns3::Socket> socket)
 
 static void send_cb(ns3::Ptr<ns3::Socket> sock, uint32_t /*txSpace*/)
 {
-  SgFlow* flow = getFlowFromSocket(sock);
+  SgFlow* flow                          = getFlowFromSocket(sock);
   const ns3::ApplicationContainer* sink = getSinkFromSocket(sock);
   XBT_DEBUG("Asked to write on F[%p, total: %u, remain: %u]", flow, flow->total_bytes_, flow->remaining_);
 
@@ -83,14 +84,14 @@ static void send_cb(ns3::Ptr<ns3::Socket> sock, uint32_t /*txSpace*/)
               flow->remaining_);
   }
 
-  if (flow->buffered_bytes_ >= flow->total_bytes_){
+  if (flow->buffered_bytes_ >= flow->total_bytes_) {
     XBT_DEBUG("Closing Sockets of flow %p", flow);
     // Closing the sockets of the receiving application
-    ns3::Ptr<ns3::PacketSink> app = ns3::DynamicCast<ns3::PacketSink, ns3::Application>(sink->Get(0));
+    ns3::Ptr<ns3::PacketSink> app        = ns3::DynamicCast<ns3::PacketSink, ns3::Application>(sink->Get(0));
     ns3::Ptr<ns3::Socket> listening_sock = app->GetListeningSocket();
     listening_sock->Close();
     listening_sock->SetRecvCallback(ns3::MakeNullCallback<void, ns3::Ptr<ns3::Socket>>());
-    for(ns3::Ptr<ns3::Socket> accepted_sock : app->GetAcceptedSockets())
+    for (ns3::Ptr<ns3::Socket> accepted_sock : app->GetAcceptedSockets())
       accepted_sock->Close();
     // Closing the socket of the sender
     sock->Close();
index d4b5d5c..0fbc70e 100644 (file)
@@ -30,7 +30,7 @@ set(EXTRA_DIST
   src/kernel/resource/models/network_constant.hpp
   src/kernel/resource/models/network_ib.hpp
   src/kernel/resource/models/network_ns3.hpp
-  src/surf/ns3/ns3_simulator.hpp
+  src/kernel/resource/models/ns3/ns3_simulator.hpp
   src/kernel/resource/models/ptask_L07.hpp
   
   src/mc/mc_mmu.hpp
@@ -294,7 +294,7 @@ endif()
 
 set(NS3_SRC
   src/kernel/resource/models/network_ns3.cpp
-  src/surf/ns3/ns3_simulator.cpp
+  src/kernel/resource/models/ns3/ns3_simulator.cpp
   )
 
 set(SURF_SRC
index 7ba0016..a8d0e65 100644 (file)
@@ -220,7 +220,7 @@ endif()
 
 # Avoid a failure seen with gcc 7.2.0 and ns3 3.27
 if(enable_ns3)
-  set_source_files_properties(src/surf/network_ns3.cpp PROPERTIES COMPILE_FLAGS " -Wno-unused-local-typedef")
+  set_source_files_properties(src/kernel/resource/models/network_ns3.cpp PROPERTIES COMPILE_FLAGS " -Wno-unused-local-typedef")
 endif()
 
 set(TESH_OPTION "")