Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Plug a memleak
[simgrid.git] / examples / cpp / task-variable-load / s4u-task-variable-load.cpp
index b0d3efd..fff790d 100644 (file)
@@ -22,13 +22,13 @@ static void variable_load(sg4::TaskPtr t)
 {
   XBT_INFO("--- Small load ---");
   for (int i = 0; i < 3; i++) {
-    t->enqueue_execs(1);
+    t->enqueue_firings(1);
     sg4::this_actor::sleep_for(100);
   }
   sg4::this_actor::sleep_until(1000);
   XBT_INFO("--- Heavy load ---");
   for (int i = 0; i < 3; i++) {
-    t->enqueue_execs(1);
+    t->enqueue_firings(1);
     sg4::this_actor::sleep_for(1);
   }
 }
@@ -50,9 +50,8 @@ int main(int argc, char* argv[])
   comm->add_successor(exec);
 
   // Add a function to be called when tasks end for log purpose
-  sg4::Task::on_end_cb([](const sg4::Task* t) {
-    XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
-  });
+  sg4::Task::on_completion_cb(
+      [](const sg4::Task* t) { XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count()); });
 
   // Create the actor that will inject load during the simulation
   sg4::Actor::create("input", tremblay, variable_load, comm);