Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics: rename a function, deprecate old name
[simgrid.git] / examples / s4u / app-token-ring / s4u-app-token-ring.cpp
index 51d44f4..f953506 100644 (file)
@@ -38,7 +38,7 @@ public:
 
     if (rank == 0) {
       /* The root process (rank 0) first sends the token then waits to receive it back */
-      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getName());
+      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getCname());
       std::string msg = "Token";
       neighbor_mailbox->put(&msg, task_comm_size);
       std::string* res = static_cast<std::string*>(my_mailbox->get());
@@ -46,7 +46,7 @@ public:
     } else {
       std::string* res = static_cast<std::string*>(my_mailbox->get());
       XBT_INFO("Host \"%u\" received \"%s\"", rank, res->c_str());
-      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getName());
+      XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->getCname());
       neighbor_mailbox->put(res, task_comm_size);
     }
   }
@@ -60,8 +60,7 @@ int main(int argc, char** argv)
 
   XBT_INFO("Number of hosts '%zu'", e.getHostCount());
   int id = 0;
-  std::vector<simgrid::s4u::Host*> list;
-  e.getHostList(&list);
+  std::vector<simgrid::s4u::Host*> list = e.getAllHosts();
   for (auto const& host : list) {
     /* - Give a unique rank to each host and create a @ref relay_runner process on each */
     simgrid::s4u::Actor::createActor((std::to_string(id)).c_str(), host, RelayRunner());