Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Extend a test to use Host::route_to
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 22 Jan 2022 22:37:37 +0000 (23:37 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sat, 22 Jan 2022 22:51:40 +0000 (23:51 +0100)
examples/cpp/platform-profile/s4u-platform-profile.cpp
examples/cpp/platform-profile/s4u-platform-profile.tesh
examples/platforms/small_platform_profile.xml

index cc64d69..1f81765 100644 (file)
@@ -19,6 +19,15 @@ static void watcher()
   const auto* link1    = simgrid::s4u::Link::by_name("1");
   const auto* link2    = simgrid::s4u::Link::by_name("2");
 
+  std::vector<simgrid::s4u::Link*> links;
+  double lat = 0;
+  jupiter->route_to(fafard, links, &lat);
+
+  std::string path;
+  for (auto* l : links)
+    path += (path.empty() ? "" : ", ") + std::string("link '") + l->get_name() + std::string("'");
+  XBT_INFO("Path from Jupiter to Fafard: %s (latency: %fs).", path.c_str(), lat);
+
   for (int i = 0; i < 10; i++) {
     XBT_INFO("Fafard: %.0fMflops, Jupiter: %4.0fMflops, Lilibeth: %3.1fMflops, Link1: (%.2fMB/s %.0fms), Link2: "
              "(%.2fMB/s %.0fms)",
index a81277b..ed6fcf1 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env tesh
 
 $ ${bindir:=.}/s4u-platform-profile ${platfdir}/small_platform_profile.xml "--log=root.fmt:[%10.6r]%e[%a]%e%m%n"
+> [  0.000000] [watcher] Path from Jupiter to Fafard: link '1', link '2' (latency: 0.020000s).
 > [  0.000000] [watcher] Fafard: 25Mflops, Jupiter:   12Mflops, Lilibeth: 25.0Mflops, Link1: (1000.00MB/s 10ms), Link2: (1000.00MB/s 10ms)
 > [  1.000000] [watcher] Fafard: 25Mflops, Jupiter:   12Mflops, Lilibeth: 25.0Mflops, Link1: (1000.00MB/s 3ms), Link2: (1000.00MB/s 10ms)
 > [  2.000000] [watcher] Fafard: 25Mflops, Jupiter:   25Mflops, Lilibeth: 12.5Mflops, Link1: (2000.00MB/s 3ms), Link2: (1000.00MB/s 10ms)
index 7fa273e..588debe 100644 (file)
@@ -12,6 +12,7 @@
       <link_ctn id="1"/>
     </route>
     <route src="Jupiter" dst="Fafard" symmetrical="NO">
+      <link_ctn id="1"/>
       <link_ctn id="2"/>
     </route>
   </zone>