Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git] / examples / cpp / task-switch-host / s4u-task-switch-host.cpp
index 3694a7d..7023f68 100644 (file)
@@ -50,11 +50,10 @@ int main(int argc, char* argv[])
     XBT_INFO("Task %s finished (%d)", t->get_name().c_str(), t->get_count());
   });
 
-  // Add a function to be called before each executions of comm0
+  // Add a function to be called before each firing of comm0
   // This function modifies the graph of tasks by adding or removing
   // successors to comm0
-  comm0->on_this_start_cb([exec1, exec2, jupiter, fafard](sg4::Task* t) {
-    auto* comm0      = dynamic_cast<sg4::CommTask*>(t);
+  comm0->on_this_start_cb([comm0, exec1, exec2, jupiter, fafard](sg4::Task*) {
     static int count = 0;
     if (count % 2 == 0) {
       comm0->set_destination(jupiter);
@@ -68,8 +67,8 @@ int main(int argc, char* argv[])
     count++;
   });
 
-  // Enqueue four executions for task comm0
-  comm0->enqueue_execs(4);
+  // Enqueue four firings for task comm0
+  comm0->enqueue_firings(4);
 
   // Start the simulation
   e.run();