X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/701ae7999bdecd06414d92d2e4b8f825afea83ee..8729da7ae2c4f5c7713c7d912c3e159227b2383b:/examples/python/actor-join/actor-join.py diff --git a/examples/python/actor-join/actor-join.py b/examples/python/actor-join/actor-join.py index 0a59caf324..770ec7662e 100644 --- a/examples/python/actor-join/actor-join.py +++ b/examples/python/actor-join/actor-join.py @@ -1,10 +1,14 @@ -# Copyright (c) 2017-2019. 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 * +""" +Usage: actor-join.py platform_file [other parameters] +""" + import sys +from simgrid import Actor, Engine, Host, this_actor def sleeper(): @@ -14,26 +18,26 @@ def sleeper(): def master(): - this_actor.info("Start sleeper") - actor = Actor.create("sleeper from master", Host.current(), sleeper) - this_actor.info("Join the sleeper (timeout 2)") + this_actor.info("Start 1st sleeper") + actor = Actor.create("1st sleeper from master", Host.current(), sleeper) + this_actor.info("Join the 1st sleeper (timeout 2)") actor.join(2) - this_actor.info("Start sleeper") - actor = Actor.create("sleeper from master", Host.current(), sleeper) - this_actor.info("Join the sleeper (timeout 4)") + this_actor.info("Start 2nd sleeper") + actor = Actor.create("2nd sleeper from master", Host.current(), sleeper) + this_actor.info("Join the 2nd sleeper (timeout 4)") actor.join(4) - this_actor.info("Start sleeper") - actor = Actor.create("sleeper from master", Host.current(), sleeper) - this_actor.info("Join the sleeper (timeout 2)") + this_actor.info("Start 3rd sleeper") + actor = Actor.create("3rd sleeper from master", Host.current(), sleeper) + this_actor.info("Join the 3rd sleeper (timeout 2)") actor.join(2) - this_actor.info("Start sleeper") - actor = Actor.create("sleeper from master", Host.current(), sleeper) + this_actor.info("Start 4th sleeper") + actor = Actor.create("4th sleeper from master", Host.current(), sleeper) this_actor.info("Waiting 4") this_actor.sleep_for(4) - this_actor.info("Join the sleeper after its end (timeout 1)") + this_actor.info("Join the 4th sleeper after its end (timeout 1)") actor.join(1) this_actor.info("Goodbye now!") @@ -55,4 +59,4 @@ if __name__ == '__main__': e.run() - this_actor.info("Simulation time {}".format(Engine.get_clock())) + this_actor.info("Simulation time {}".format(e.clock))