X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/237fd22b56db7d1c67360c37559ce3aab16a002d..63fdbfa257867cde545185eaa0eb7a6505506a89:/examples/cpp/plugin-prodcons/s4u-plugin-prodcons.cpp diff --git a/examples/cpp/plugin-prodcons/s4u-plugin-prodcons.cpp b/examples/cpp/plugin-prodcons/s4u-plugin-prodcons.cpp index fc20568df7..8d1ceeb12a 100644 --- a/examples/cpp/plugin-prodcons/s4u-plugin-prodcons.cpp +++ b/examples/cpp/plugin-prodcons/s4u-plugin-prodcons.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. 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. */ @@ -58,19 +58,16 @@ int main(int argc, char* argv[]) // Platform creation auto* cluster = sg4::create_star_zone("cluster"); for (int i = 0; i < 8; i++) { - std::string hostname = std::string("node-") + std::to_string(i) + ".simgrid.org"; + std::string hostname = "node-" + std::to_string(i) + ".simgrid.org"; const auto* host = cluster->create_host(hostname, "1Gf"); - std::string linkname = std::string("cluster") + "_link_" + std::to_string(i); + std::string linkname = "cluster_link_" + std::to_string(i); const auto* link = cluster->create_split_duplex_link(linkname, "1Gbps"); - cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, {{link, sg4::LinkInRoute::Direction::UP}}, - true); + cluster->add_route(host, nullptr, {{link, sg4::LinkInRoute::Direction::UP}}, true); } - - auto* router = cluster->create_router("cluster_router"); - cluster->add_route(router, nullptr, nullptr, nullptr, {}); + cluster->seal(); simgrid::plugin::ProducerConsumerPtr pc = simgrid::plugin::ProducerConsumer::create(2); @@ -78,11 +75,11 @@ int main(int argc, char* argv[]) XBT_INFO("Transfers are done in %s mode", pc->get_transfer_mode().c_str()); for (int i = 0; i < 3; i++) { - std::string hostname = std::string("node-") + std::to_string(i) + ".simgrid.org"; - sg4::Actor::create("ingester-" + std::to_string(i), sg4::Host::by_name(hostname), &ingester, i, pc); + std::string hostname = "node-" + std::to_string(i) + ".simgrid.org"; + sg4::Actor::create("ingester-" + std::to_string(i), e.host_by_name(hostname), &ingester, i, pc); - hostname = std::string("node-") + std::to_string(i + 3) + ".simgrid.org"; - sg4::Actor::create("retriever-" + std::to_string(i), sg4::Host::by_name(hostname), &retriever, pc); + hostname = "node-" + std::to_string(i + 3) + ".simgrid.org"; + sg4::Actor::create("retriever-" + std::to_string(i), e.host_by_name(hostname), &retriever, pc); } e.run();