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.
10 this_actor.info("Sleeper started")
11 this_actor.sleep_for(3)
12 this_actor.info("I'm done. See you!")
15 this_actor.info("Start sleeper")
16 actor = Actor.create("sleeper from master", Host.current(), sleeper)
17 this_actor.info("Join the sleeper (timeout 2)")
20 this_actor.info("Start sleeper")
21 actor = Actor.create("sleeper from master", Host.current(), sleeper)
22 this_actor.info("Join the sleeper (timeout 4)")
25 this_actor.info("Start sleeper")
26 actor = Actor.create("sleeper from master", Host.current(), sleeper)
27 this_actor.info("Join the sleeper (timeout 2)")
30 this_actor.info("Start sleeper")
31 actor = Actor.create("sleeper from master", Host.current(), sleeper)
32 this_actor.info("Waiting 4")
33 this_actor.sleep_for(4)
34 this_actor.info("Join the sleeper after its end (timeout 1)")
37 this_actor.info("Goodbye now!")
39 this_actor.sleep_for(1)
41 this_actor.info("Goodbye now!")
43 if __name__ == '__main__':
45 if len(sys.argv) < 2: raise AssertionError("Usage: actor-join.py platform_file [other parameters]")
47 e.load_platform(sys.argv[1])
49 Actor.create("master", Host.by_name("Tremblay"), master)
53 this_actor.info("Simulation time {}".format(Engine.get_clock()))