Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix how wifi's host_rate is used in communicate()
[simgrid.git] / teshsuite / surf / wifi_usage / wifi_usage.cpp
index d6929d6360d907d6c7f9f61912f5cb68fa1f1393..b510cd293c0d1fd1acea715dac0b1ed5c1d55f47 100644 (file)
@@ -4,14 +4,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/s4u.hpp"
+#include "xbt/config.hpp"
 #include "xbt/log.h"
 
-#include "simgrid/msg.h"
 #include "src/surf/network_wifi.hpp"
-#include <exception>
-#include <iostream>
-#include <random>
-#include <string>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[usage] wifi_usage <platform-file>");
 
@@ -78,6 +74,7 @@ void run_ping_test(const char* src, const char* dest, int data_size)
   simgrid::s4u::Actor::create("receiver", simgrid::s4u::Host::by_name(dest), [mailbox]() { mailbox->get(); });
   auto* l = (simgrid::kernel::resource::NetworkWifiLink*)simgrid::s4u::Link::by_name("AP1")->get_impl();
   l->set_host_rate(simgrid::s4u::Host::by_name(src), 0);
+  l->set_host_rate(simgrid::s4u::Host::by_name(dest), 0);
   simgrid::s4u::this_actor::sleep_for(10);
   XBT_INFO("\n");
 }