X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3fb28e990d3e18eef76fa5d21a134f0bd4e2fbaa..9fc682676a33abb6a4cc527c09a34db3c33e5711:/examples/python/task-simple/task-simple.py diff --git a/examples/python/task-simple/task-simple.py b/examples/python/task-simple/task-simple.py index 1219906ce9..beca2b6a2c 100644 --- a/examples/python/task-simple/task-simple.py +++ b/examples/python/task-simple/task-simple.py @@ -28,13 +28,12 @@ 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() e = Engine(sys.argv) e.load_platform(args.platform) - Task.init() # Retrieve hosts tremblay = e.host_by_name('Tremblay') @@ -50,11 +49,10 @@ if __name__ == '__main__': comm.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() -