X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9104957deccc59e0e804215d5db498fabfd40d29..c4c82977e0a105cdf7b04010ddd21bbf15dced4d:/examples/python/exec-async/exec-async.py diff --git a/examples/python/exec-async/exec-async.py b/examples/python/exec-async/exec-async.py index c0d9a73b1e..5892dca6ea 100644 --- a/examples/python/exec-async/exec-async.py +++ b/examples/python/exec-async/exec-async.py @@ -1,14 +1,21 @@ -# Copyright (c) 2018-2020. The SimGrid Team. All rights reserved. +# Copyright (c) 2018-2023. The SimGrid Team. All rights reserved. # # This program is free software you can redistribute it and/or modify it # under the terms of the license (GNU LGPL) which comes with this package. -from simgrid import Actor, Engine, Host, this_actor +""" +Usage: exec-async.py platform_file [other parameters] +""" + import sys +from simgrid import Actor, Engine, Host, this_actor class Waiter: - """ This actor simply waits for its task completion after starting it. That's exactly equivalent to synchronous execution. """ + """ + This actor simply waits for its task completion after starting it. + That's exactly equivalent to synchronous execution. + """ def __call__(self): computation_amount = this_actor.get_host().speed @@ -43,7 +50,7 @@ class Canceller: def __call__(self): computation_amount = this_actor.get_host().speed this_actor.info("Canceller executes {:.0f} flops, should take 1 second.".format(computation_amount)) - activity = this_actor.exec_init(computation_amount).start() + activity = this_actor.exec_async(computation_amount) this_actor.sleep_for(0.5) this_actor.info("I changed my mind, cancel!")