X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3b7e5f4b4d7c87ee3e8827313ec966ea8fc8387..bfffef69e1b0554d13eec920f1a32f75b49ceac6:/examples/python/actor-suspend/actor-suspend.py diff --git a/examples/python/actor-suspend/actor-suspend.py b/examples/python/actor-suspend/actor-suspend.py index 95e055b5fe..1aa545dc94 100644 --- a/examples/python/actor-suspend/actor-suspend.py +++ b/examples/python/actor-suspend/actor-suspend.py @@ -1,14 +1,18 @@ -# Copyright (c) 2017-2020. The SimGrid Team. All rights reserved. +# Copyright (c) 2017-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, this_actor +""" +Usage: actor-suspend.py platform_file [other parameters] +""" + import sys +from simgrid import Actor, Engine, this_actor def lazy_guy(): - """The Lazy guy only wants to sleep, but can be awaken by the dream_master process""" + """The Lazy guy only wants to sleep, but can be awaken by the dream_master actor""" this_actor.info("Nobody's watching me ? Let's go to sleep.") this_actor.suspend() # - Start by suspending itself this_actor.info("Uuuh ? Did somebody call me ?") @@ -30,7 +34,7 @@ def lazy_guy(): def dream_master(): """The Dream master""" - this_actor.info("Let's create a lazy guy.") # Create a lazy_guy process + this_actor.info("Let's create a lazy guy.") # Create a lazy_guy actor lazy = Actor.create("Lazy", this_actor.get_host(), lazy_guy) this_actor.info("Let's wait a little bit...") this_actor.sleep_for(10) # Wait for 10 seconds @@ -75,7 +79,7 @@ if __name__ == '__main__': "Usage: actor-suspend.py platform_file [other parameters]") e.load_platform(sys.argv[1]) # Load the platform description - hosts = e.get_all_hosts() + hosts = e.all_hosts Actor.create("dream_master", hosts[0], dream_master) e.run() # Run the simulation