Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Give a way to add binaries to the list that shouldn't be messed with by sthread
[simgrid.git] / examples / cpp / task-io / s4u-task-io.cpp
index 19102f25a58d25788c0430484b12ca772b96d919..c0f6eb0a3b7ae44372f0cbc701f1693af40834bf 100644 (file)
@@ -13,8 +13,8 @@
  * comm is a communication task.
  */
 
-#include "simgrid/s4u/Task.hpp"
 #include "simgrid/s4u.hpp"
+#include "simgrid/s4u/Task.hpp"
 #include <simgrid/plugins/file_system.h>
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(task_simple, "Messages specific for this task example");
@@ -41,12 +41,11 @@ int main(int argc, char* argv[])
   read->add_successor(exec2);
 
   // 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()); });
 
-  // Enqueue two executions for task exec1
-  exec1->enqueue_execs(2);
+  // Enqueue two firings for task exec1
+  exec1->enqueue_firings(2);
 
   // Start the simulation
   e.run();