Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
save some hidden calls to Engine::get_instance
[simgrid.git] / teshsuite / s4u / wait-any-for / wait-any-for.cpp
index 3c4200c..b10b4ff 100644 (file)
@@ -31,11 +31,11 @@ static void worker()
   std::vector<simgrid::s4u::CommPtr> comms = {put1, put2, get1, get2};
 
   while (not comms.empty()) {
-    int index = simgrid::s4u::Comm::wait_any_for(&comms, 0.5);
+    ssize_t index = simgrid::s4u::Comm::wait_any_for(comms, 0.5);
     if (index < 0)
       XBT_INFO("wait_any_for: Timeout reached");
     else {
-      XBT_INFO("wait_any_for: A comm finished (index=%d, #comms=%zu)", index, comms.size());
+      XBT_INFO("wait_any_for: A comm finished (index=%zd, #comms=%zu)", index, comms.size());
       comms.erase(comms.begin() + index);
     }
   }
@@ -49,7 +49,7 @@ int main(int argc, char* argv[])
 {
   simgrid::s4u::Engine e(&argc, argv);
   e.load_platform(argv[1]);
-  simgrid::s4u::Actor::create("worker", simgrid::s4u::Host::by_name("Tremblay"), worker);
+  simgrid::s4u::Actor::create("worker", e.host_by_name("Tremblay"), worker);
   e.run();
   return 0;
 }