Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adjust dynamic network-factors test.
authorBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 28 May 2021 10:08:26 +0000 (12:08 +0200)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Tue, 1 Jun 2021 14:34:08 +0000 (16:34 +0200)
Improve test, including no crosstraffic config.

examples/cpp/network-factors/s4u-network-factors.cpp
examples/cpp/network-factors/s4u-network-factors.tesh

index e4235a0..0e2d09d 100644 (file)
@@ -151,9 +151,14 @@ static double bandwidth_factor_cb(double size, const sg4::Host* src, const sg4::
 /*************************************************************************************************/
 class Sender {
   std::vector<sg4::Host*> hosts_;
+  double crosstraffic_ = 1.0;
 
 public:
-  explicit Sender(const std::vector<sg4::Host*>& hosts) : hosts_{hosts} {}
+  explicit Sender(const std::vector<sg4::Host*>& hosts, bool crosstraffic) : hosts_{hosts}
+  {
+    if (crosstraffic)
+      crosstraffic_ = 1.05; // add crosstraffic load if it is enabled
+  }
   void operator()() const
   {
     const std::vector<double> msg_sizes = {64e3, 64e6, 64e9}; // 64KB, 64MB, 64GB
@@ -165,7 +170,11 @@ public:
         if (host->get_name() == sg4::this_actor::get_host()->get_name()) {
           double lat_factor = get_factor_from_map(LOCAL_LAT_FACTOR, size);
           double bw_factor  = get_factor_from_map(LOCAL_BW_FACTOR, size);
-          double est_time   = sg4::Engine::get_clock() + size / (BW_LOCAL * bw_factor) + LATENCY * lat_factor;
+          /* Account for crosstraffic on local communications
+           * local communications use only a single link and crosstraffic impact on resource sharing
+           * on remote communications, we don't see this effect since we have split-duplex links */
+          double est_time =
+              sg4::Engine::get_clock() + size / (BW_LOCAL * bw_factor / crosstraffic_) + LATENCY * lat_factor;
 
           msg = "Local communication: size=" + std::to_string(size) + ". Use bw_factor=" + std::to_string(bw_factor) +
                 " lat_factor=" + std::to_string(lat_factor) + ". Estimated finished time=" + std::to_string(est_time);
@@ -211,10 +220,17 @@ public:
 /*************************************************************************************************/
 int main(int argc, char* argv[])
 {
+  bool crosstraffic = true;
   sg4::Engine e(&argc, argv);
   /* setting network model to default one */
   sg4::Engine::set_config("network/model:CM02");
 
+  /* test with crosstraffic disabled */
+  if (argc == 2 && std::string(argv[1]) == "disable_crosstraffic") {
+    sg4::Engine::set_config("network/crosstraffic:0");
+    crosstraffic = false;
+  }
+
   /* create platform */
   load_platform();
   /* setting network factors callbacks */
@@ -226,7 +242,8 @@ int main(int argc, char* argv[])
   sg4::Host* host_remote = e.host_by_name("dahu-10.grid5000.fr");
   sg4::Actor::create(std::string("receiver-local"), host, Receiver());
   sg4::Actor::create(std::string("receiver-remote"), host_remote, Receiver());
-  sg4::Actor::create(std::string("sender") + std::string(host->get_name()), host, Sender({host, host_remote}));
+  sg4::Actor::create(std::string("sender") + std::string(host->get_name()), host,
+                     Sender({host, host_remote}, crosstraffic));
 
   /* runs the simulation */
   e.run();
index 86d7a07..22f1b03 100644 (file)
@@ -1,5 +1,6 @@
-$ ${bindir:=.}/s4u-network-factors "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
+$ ${bindir:=.}/s4u-network-factors disable_crosstraffic "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/crosstraffic' to '0'
 > [  0.000086] (1:receiver-local@dahu-1.grid5000.fr) I got a 'Local communication: size=64000.000000. Use bw_factor=0.121192 lat_factor=650.221238. Estimated finished time=0.000086'.
 > [  0.000455] (2:receiver-remote@dahu-10.grid5000.fr) I got a 'Remote communication: size=64000.000000. Use bw_factor=0.316335 lat_factor=1761.478483. Estimated finished time=0.000455'.
 > [  0.060247] (1:receiver-local@dahu-1.grid5000.fr) I got a 'Local communication: size=64000000.000000. Use bw_factor=0.042815 lat_factor=0.000000. Estimated finished time=0.060247'.
@@ -9,3 +10,15 @@ $ ${bindir:=.}/s4u-network-factors "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
 > [ 27.801800] (3:senderdahu-1.grid5000.fr@dahu-1.grid5000.fr) Done dispatching all messages
 > [ 27.801800] (1:receiver-local@dahu-1.grid5000.fr) I got a 'finalize'.
 > [ 27.801800] (2:receiver-remote@dahu-10.grid5000.fr) I got a 'finalize'.
+
+$ ${bindir:=.}/s4u-network-factors "--log=root.fmt:[%10.6r]%e(%i:%a@%h)%e%m%n"
+> [  0.000000] (0:maestro@) Configuration change: Set 'network/model' to 'CM02'
+> [  0.000087] (1:receiver-local@dahu-1.grid5000.fr) I got a 'Local communication: size=64000.000000. Use bw_factor=0.121192 lat_factor=650.221238. Estimated finished time=0.000087'.
+> [  0.000456] (2:receiver-remote@dahu-10.grid5000.fr) I got a 'Remote communication: size=64000.000000. Use bw_factor=0.316335 lat_factor=1761.478483. Estimated finished time=0.000456'.
+> [  0.063237] (1:receiver-local@dahu-1.grid5000.fr) I got a 'Local communication: size=64000000.000000. Use bw_factor=0.042815 lat_factor=0.000000. Estimated finished time=0.063237'.
+> [  0.112683] (2:receiver-remote@dahu-10.grid5000.fr) I got a 'Remote communication: size=64000000.000000. Use bw_factor=0.103547 lat_factor=0.000000. Estimated finished time=0.112683'.
+> [ 15.626857] (1:receiver-local@dahu-1.grid5000.fr) I got a 'Local communication: size=64000000000.000000. Use bw_factor=0.174405 lat_factor=1017885.351877. Estimated finished time=15.626857'.
+> [ 28.538713] (2:receiver-remote@dahu-10.grid5000.fr) I got a 'Remote communication: size=64000000000.000000. Use bw_factor=0.402589 lat_factor=970913.455816. Estimated finished time=28.538713'.
+> [ 28.538713] (3:senderdahu-1.grid5000.fr@dahu-1.grid5000.fr) Done dispatching all messages
+> [ 28.538713] (1:receiver-local@dahu-1.grid5000.fr) I got a 'finalize'.
+> [ 28.538713] (2:receiver-remote@dahu-10.grid5000.fr) I got a 'finalize'.