Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix all Task examples to support the new Task format with dispatcher and collector
[simgrid.git] / examples / python / task-io / task-io.py
index 431a789..d3ab8c1 100644 (file)
@@ -18,7 +18,7 @@ def parse():
     return parser.parse_args()
 
 def callback(t):
-    print(f'[{Engine.clock}] {t} finished ({t.count})')
+    print(f'[{Engine.clock}] {t} finished ({t.get_count()})')
 
 if __name__ == '__main__':
     args = parse()
@@ -41,10 +41,10 @@ if __name__ == '__main__':
     read.add_successor(exec2)
 
     # Add a function to be called when tasks end for log purpose
-    Task.on_end_cb(callback)
+    Task.on_completion_cb(callback)
 
-    # Enqueue two executions for task exec1
-    exec1.enqueue_execs(2)
+    # Enqueue two firings for task exec1
+    exec1.enqueue_firings(2)
 
     # runs the simulation
     e.run()