X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3e370be29ddc5c64412b9634097f32fed3a22a3d..b83bdf8faae7ba64d66c529754159a164b70104d:/examples/python/actor-kill/actor-kill.py diff --git a/examples/python/actor-kill/actor-kill.py b/examples/python/actor-kill/actor-kill.py index bb85af93df..5adff3112d 100644 --- a/examples/python/actor-kill/actor-kill.py +++ b/examples/python/actor-kill/actor-kill.py @@ -1,10 +1,14 @@ -# Copyright (c) 2017-2019. The SimGrid Team. All rights reserved. +# Copyright (c) 2017-2022. 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 * +""" +Usage: actor-kill.py platform_file [other parameters] +""" + import sys +from simgrid import Actor, Engine, Host, this_actor def victim_a_fun(): @@ -24,7 +28,7 @@ def victim_b_fun(): def killer(): - this_actor.info("Hello!") # - First start a victim process + this_actor.info("Hello!") # - First start a victim actor victim_a = Actor.create("victim A", Host.by_name("Fafard"), victim_a_fun) victim_b = Actor.create("victim B", Host.by_name("Jupiter"), victim_b_fun) this_actor.sleep_for(10) # - Wait for 10 seconds @@ -40,7 +44,7 @@ def killer(): this_actor.sleep_for(1) # that's a no-op, there is no zombies in SimGrid - this_actor.info("Kill victim_b, even if it's already dead") + this_actor.info("Kill victim B, even if it's already dead") victim_b.kill() this_actor.sleep_for(1) @@ -68,7 +72,7 @@ if __name__ == '__main__': "Usage: actor-kill.py platform_file [other parameters]") e.load_platform(sys.argv[1]) # Load the platform description - # Create and deploy killer process, that will create the victim actors + # Create and deploy killer actor, that will create the victim actors Actor.create("killer", Host.by_name("Tremblay"), killer) e.run()