X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d656f9465e7b1c36319f86eeafdcec58fe9551a4..6157f90cc9d3cce63b341338c15e91af8ccd6347:/examples/s4u/app-token-ring/s4u-app-token-ring.cpp diff --git a/examples/s4u/app-token-ring/s4u-app-token-ring.cpp b/examples/s4u/app-token-ring/s4u-app-token-ring.cpp index 388e19f6fe..fec72b7ccc 100644 --- a/examples/s4u/app-token-ring/s4u-app-token-ring.cpp +++ b/examples/s4u/app-token-ring/s4u-app-token-ring.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2017-2018. 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. */ @@ -23,7 +23,7 @@ public: void operator()() { try { - rank = std::stoi(simgrid::s4u::this_actor::getName()); + rank = std::stoi(simgrid::s4u::this_actor::get_name()); } catch (std::invalid_argument& ia) { throw std::invalid_argument(std::string("Processes of this example must have a numerical name, not ") + ia.what()); @@ -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->getCname()); + XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname()); std::string msg = "Token"; neighbor_mailbox->put(&msg, task_comm_size); std::string* res = static_cast(my_mailbox->get()); @@ -46,7 +46,7 @@ public: } else { std::string* res = static_cast(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->getCname()); + XBT_INFO("Host \"%u\" send 'Token' to Host \"%s\"", rank, neighbor_mailbox->get_cname()); neighbor_mailbox->put(res, task_comm_size); } } @@ -60,11 +60,10 @@ int main(int argc, char** argv) XBT_INFO("Number of hosts '%zu'", e.getHostCount()); int id = 0; - std::vector list; - e.getHostList(&list); + std::vector 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()); + simgrid::s4u::Actor::create((std::to_string(id)).c_str(), host, RelayRunner()); id++; } e.run();