Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar, set_config is a static method
[simgrid.git] / teshsuite / models / cm02-set-lat-bw / cm02-set-lat-bw.cpp
index 9dc4d4f31aa992f8dd4970a3db545981ba4160c5..9dacdf99cd37532bf155188c6122205dcaf5b5d0 100644 (file)
@@ -82,13 +82,11 @@ static void sender(const std::string& recv_name, sg4::Link* l4)
 static void receiver()
 {
   sg4::Mailbox* mbox = sg4::Mailbox::by_name(sg4::this_actor::get_host()->get_name());
-  double* payload    = nullptr;
   while (true) {
-    payload = mbox->get<double>();
+    auto payload = mbox->get_unique<double>();
     if (*payload < 0)
       break;
     XBT_INFO("Received data. Elapsed %lf", sg4::Engine::get_clock() - *payload);
-    delete payload;
   }
   XBT_INFO("Bye");
 }
@@ -98,9 +96,9 @@ int main(int argc, char** argv)
 {
   sg4::Engine e(&argc, argv);
   /* keep it simple, no network factors nor crosstrafic */
-  simgrid::s4u::Engine::set_config("network/model:CM02");
-  simgrid::s4u::Engine::set_config("network/weight-S:20537");
-  simgrid::s4u::Engine::set_config("network/crosstraffic:0");
+  sg4::Engine::set_config("network/model:CM02");
+  sg4::Engine::set_config("network/weight-S:20537");
+  sg4::Engine::set_config("network/crosstraffic:0");
 
   /* dog-bone platform */
   std::unordered_map<std::string, sg4::Host*> hosts;