1 # Copyright (c) 2017-2019. The SimGrid Team. All rights reserved.
3 # This program is free software you can redistribute it and/or modify it
4 # under the terms of the license (GNU LGPL) which comes with this package.
11 this_actor.info("Sleeper started")
12 this_actor.sleep_for(3)
13 this_actor.info("I'm done. See you!")
17 this_actor.info("Start sleeper")
18 actor = Actor.create("sleeper from master", Host.current(), sleeper)
19 this_actor.info("Join the sleeper (timeout 2)")
22 this_actor.info("Start sleeper")
23 actor = Actor.create("sleeper from master", Host.current(), sleeper)
24 this_actor.info("Join the sleeper (timeout 4)")
27 this_actor.info("Start sleeper")
28 actor = Actor.create("sleeper from master", Host.current(), sleeper)
29 this_actor.info("Join the sleeper (timeout 2)")
32 this_actor.info("Start sleeper")
33 actor = Actor.create("sleeper from master", Host.current(), sleeper)
34 this_actor.info("Waiting 4")
35 this_actor.sleep_for(4)
36 this_actor.info("Join the sleeper after its end (timeout 1)")
39 this_actor.info("Goodbye now!")
41 this_actor.sleep_for(1)
43 this_actor.info("Goodbye now!")
46 if __name__ == '__main__':
50 "Usage: actor-join.py platform_file [other parameters]")
52 e.load_platform(sys.argv[1])
54 Actor.create("master", Host.by_name("Tremblay"), master)
58 this_actor.info("Simulation time {}".format(Engine.get_clock()))