1 # Copyright (c) 2018-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.
6 from simgrid import Actor, Engine, Host, this_actor
13 fafard = Host.by_name("Fafard")
14 ginette = Host.by_name("Ginette")
15 boivin = Host.by_name("Boivin")
17 this_actor.info("I'm a wizard! I can run a task on the Ginette host from the Fafard one! Look!")
18 activity = this_actor.exec_init(48.492e6)
19 activity.host = ginette
21 this_actor.info("It started. Running 48.492Mf takes exactly one second on Ginette (but not on Fafard).")
23 this_actor.sleep_for(0.1)
24 this_actor.info("Loads in flops/s: Boivin={:.0f}; Fafard={:.0f}; Ginette={:.0f}".format(boivin.load, fafard.load,
27 this_actor.info("Done!")
29 this_actor.info("And now, harder. Start a remote task on Ginette and move it to Boivin after 0.5 sec")
30 activity = this_actor.exec_init(73293500)
31 activity.host = ginette
34 this_actor.sleep_for(0.5)
36 "Loads before the move: Boivin={:.0f}; Fafard={:.0f}; Ginette={:.0f}".format(
41 activity.host = boivin
43 this_actor.sleep_for(0.1)
45 "Loads after the move: Boivin={:.0f}; Fafard={:.0f}; Ginette={:.0f}".format(
51 this_actor.info("Done!")
54 if __name__ == '__main__':
57 e.load_platform(sys.argv[1])
59 Actor.create("test", Host.by_name("Fafard"), Wizard())