-/* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2022. 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. */
/* create the backbone link */
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) {
/* add link and backbone for communications from the host */
cluster->add_route(host->get_netpoint(), nullptr, nullptr, nullptr,
- std::vector<sg4::LinkInRoute>{{link, sg4::LinkInRoute::Direction::UP}, l_bb}, true);
+ {{link, sg4::LinkInRoute::Direction::UP}, backbone}, true);
}
/* create router */
simgrid::kernel::routing::NetPoint* router;
/* create top link */
- const 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<int> rad(32);
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
+}