Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sanitize the prototype of Actor::on_exit() callbacks
[simgrid.git] / examples / s4u / app-chainsend / s4u-app-chainsend.cpp
index d4d3d72..39ee01d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
 
 /* 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. */
@@ -6,9 +6,9 @@
 #include "simgrid/s4u.hpp"
 #include <vector>
 
-#define PIECE_SIZE 65536
-#define MESSAGE_BUILD_CHAIN_SIZE 40
-#define MESSAGE_SEND_DATA_HEADER_SIZE 1
+constexpr unsigned PIECE_SIZE                    = 65536;
+constexpr unsigned MESSAGE_BUILD_CHAIN_SIZE      = 40;
+constexpr unsigned MESSAGE_SEND_DATA_HEADER_SIZE = 1;
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_chainsend, "Messages specific for chainsend");
 
@@ -42,7 +42,7 @@ public:
   unsigned int received_pieces      = 0;
   unsigned int total_pieces         = 0;
 
-  Peer() { me = simgrid::s4u::Mailbox::byName(simgrid::s4u::Host::current()->get_cname()); }
+  Peer() { me = simgrid::s4u::Mailbox::by_name(simgrid::s4u::Host::current()->get_cname()); }
   ~Peer()     = default;
 
   void joinChain()
@@ -144,9 +144,9 @@ public:
   Broadcaster(int hostcount, unsigned int piece_count) : piece_count(piece_count)
   {
     for (int i = 1; i <= hostcount; i++) {
-      std::string name = std::string("node-") + std::to_string(i) + ".acme.org";
+      std::string name = std::string("node-") + std::to_string(i) + ".simgrid.org";
       XBT_DEBUG("%s", name.c_str());
-      mailboxes.push_back(simgrid::s4u::Mailbox::byName(name));
+      mailboxes.push_back(simgrid::s4u::Mailbox::by_name(name));
     }
   }
 
@@ -189,16 +189,16 @@ int main(int argc, char* argv[])
 
   e.load_platform(argv[1]);
 
-  simgrid::s4u::Actor::create("broadcaster", simgrid::s4u::Host::by_name("node-0.acme.org"), broadcaster, 8, 256);
+  simgrid::s4u::Actor::create("broadcaster", simgrid::s4u::Host::by_name("node-0.simgrid.org"), broadcaster, 8, 256);
 
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-1.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-2.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-3.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-4.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-5.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-6.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-7.acme.org"), peer);
-  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-8.acme.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-1.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-2.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-3.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-4.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-5.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-6.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-7.simgrid.org"), peer);
+  simgrid::s4u::Actor::create("peer", simgrid::s4u::Host::by_name("node-8.simgrid.org"), peer);
 
   e.run();
   XBT_INFO("Total simulation time: %e", simgrid::s4u::Engine::get_clock());