X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63dae9fee48b67ed8302130aa84c8a54cd42241b..15f7e082b6a5831848150c7a95dab8b60b99ecce:/examples/platforms/griffon.cpp diff --git a/examples/platforms/griffon.cpp b/examples/platforms/griffon.cpp index 3b9207a7d2..8adfdc0c66 100644 --- a/examples/platforms/griffon.cpp +++ b/examples/platforms/griffon.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2006-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. */ @@ -27,7 +27,8 @@ create_cabinet(const sg4::NetZone* root, const std::string& name, const std::vec cluster->set_parent(root); /* create the backbone link */ - sg4::Link* l_bb = cluster->create_link("backbone-" + name, "1.25GBps")->seal(); + const sg4::Link* l_bb = cluster->create_link("backbone-" + name, "1.25GBps")->seal(); + sg4::LinkInRoute backbone(l_bb); /* create all hosts and connect them to outside world */ for (const auto& id : radicals) { @@ -35,11 +36,11 @@ create_cabinet(const sg4::NetZone* root, const std::string& name, const std::vec /* create host */ const sg4::Host* host = cluster->create_host(hostname, "286.087kf"); /* create UP/DOWN link */ - auto* link = cluster->create_split_duplex_link(hostname, "125MBps")->set_latency("24us")->seal(); + const sg4::Link* link = cluster->create_split_duplex_link(hostname, "125MBps")->set_latency("24us")->seal(); /* add link and backbone for communications from the host */ cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, - std::vector{{link, sg4::LinkInRoute::Direction::UP}, l_bb}, true); + {{link, sg4::LinkInRoute::Direction::UP}, backbone}, true); } /* create router */ @@ -77,7 +78,8 @@ void load_platform(const sg4::Engine& /*e*/) simgrid::kernel::routing::NetPoint* router; /* create top link */ - sg4::Link* link = root->create_link("backbone", "1.25GBps")->set_latency("24us")->seal(); + const sg4::Link* l_bb = root->create_link("backbone", "1.25GBps")->set_latency("24us")->seal(); + sg4::LinkInRoute backbone{l_bb}; /* create cabinet1 */ std::vector rad(32); @@ -86,19 +88,19 @@ void load_platform(const sg4::Engine& /*e*/) rad[rad.size() - 2] = 59; rad[rad.size() - 3] = 58; std::tie(cab_zone, router) = create_cabinet(root, "cabinet1", rad); - root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {link}); + root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {backbone}); /* create cabinet2 */ rad.resize(28); std::iota(rad.begin(), rad.end(), 30); // 30-57 std::tie(cab_zone, router) = create_cabinet(root, "cabinet2", rad); - root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {link}); + root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {backbone}); /* create cabinet3 */ rad.resize(32); std::iota(rad.begin(), rad.end(), 61); // 61-92 std::tie(cab_zone, router) = create_cabinet(root, "cabinet3", rad); - root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {link}); + root->add_route(cab_zone->get_netpoint(), nullptr, router, nullptr, {backbone}); root->seal(); -} \ No newline at end of file +}