Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert getCname to get_cname
[simgrid.git] / examples / s4u / platform-properties / s4u-platform-properties.cpp
index d8f4129..0194a22 100644 (file)
@@ -3,6 +3,8 @@
 /* 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. */
 
+// TODO: also test the properties attached to links
+
 #include <simgrid/s4u.hpp>
 #include <string>
 
@@ -104,9 +106,9 @@ int main(int argc, char* argv[])
   size_t totalHosts = sg_host_count();
 
   XBT_INFO("There are %zu hosts in the environment", totalHosts);
-  simgrid::s4u::Host** hosts = sg_host_list();
-  for (unsigned int i = 0; i < totalHosts; i++)
-    XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->getCname(), hosts[i]->getSpeed());
+  std::vector<simgrid::s4u::Host*> hosts = e.getAllHosts();
+  for (unsigned int i = 0; i < hosts.size(); i++)
+    XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->get_cname(), hosts[i]->getSpeed());
 
   e.loadDeployment(argv[2]);
   e.run();