1 # Copyright (c) 2018. 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 # execute() tells SimGrid to pause the calling actor until
11 # its host has computed the amount of flops passed as a parameter
12 this_actor.execute(98095)
13 this_actor.info("Done.")
14 # This simple example does not do anything beyond that
17 # This version of execute() with two parameters specifies that this execution
18 # gets a larger share of the resource.
20 # Since the priority is 2, it computes twice as fast as a regular one.
22 # So instead of a half/half sharing between the two executions,
23 # we get a 1/3 vs 2/3 sharing.
24 this_actor.execute(98095, 2);
25 this_actor.info("Done.");
27 # Note that the timings printed when executing this example are a bit misleading,
28 # because the uneven sharing only last until the privileged actor ends.
29 # After this point, the unprivileged one gets 100% of the CPU and finishes
34 i = sys.argv.index("--")
35 e = Engine(sys.argv[0:i])
36 e.load_platform(sys.argv[i+1])
38 Actor.create("executor", Host.by_name("Tremblay"), executor)
39 Actor.create("privileged", Host.by_name("Tremblay"), privileged)