Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
first attempt to a DAG loader for s4u. To be improved and polished before release
[simgrid.git] / examples / cpp / network-factors / s4u-network-factors.cpp
index 0e2d09d53625adc52b001415cf1e72e9ffe9c80b..3f8598e3021906ce16e34a2f4d30a7504f48150d 100644 (file)
@@ -75,15 +75,13 @@ static void load_platform()
     /* create host */
     const sg4::Host* host = root->create_host(hostname, 1)->set_core_count(32)->seal();
     /* create UP/DOWN link */
-    sg4::Link* l_up   = root->create_link(hostname + "_up", BW_REMOTE)->set_latency(LATENCY)->seal();
-    sg4::Link* l_down = root->create_link(hostname + "_down", BW_REMOTE)->set_latency(LATENCY)->seal();
+    const sg4::Link* l = root->create_split_duplex_link(hostname, BW_REMOTE)->set_latency(LATENCY)->seal();
 
     /* add link UP/DOWN for communications from the host */
-    root->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, std::vector<sg4::Link*>{l_up}, false);
-    root->add_route(nullptr, host->get_netpoint(), nullptr, nullptr, std::vector<sg4::Link*>{l_down}, false);
+    root->add_route(host->get_netpoint(), nullptr, nullptr, nullptr, {{l, sg4::LinkInRoute::Direction::UP}}, true);
 
-    sg4::Link* loopback = root->create_link(hostname + "_loopback", BW_LOCAL)->set_latency(LATENCY)->seal();
-    root->add_route(host->get_netpoint(), host->get_netpoint(), nullptr, nullptr, std::vector<sg4::Link*>{loopback});
+    const sg4::Link* loopback = root->create_link(hostname + "_loopback", BW_LOCAL)->set_latency(LATENCY)->seal();
+    root->add_route(host->get_netpoint(), host->get_netpoint(), nullptr, nullptr, {sg4::LinkInRoute(loopback)});
   }
 
   root->seal();