Deploying your Application¶
There is several ways to deploy the application you want to study on your simulated platform, i.e. to specify which actor should be started on which host. You can do so directly in your program (as shown in these examples), or using an XML deployment file. Unless you have a good reason, you should keep your application apart from the deployment as it will ease your experimental campain afterward.
Deploying actors from XML is easy: it only involves 3 tags: <actor>,
<argument>, and <prop>. They must be placed in an
encompassing <platform>. Here is a first example (search in the
archive for files named
???_d.xml for more):
<?xml version='1.0'?> <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd"> <platform version="4.1"> <!-- The following starts an actor that runs the function `alice()` on the given host. -- It is not given any parameter, so its args is empty. --> <actor host="host1" function="alice" /> <!-- The following starts another actor that runs `bob()` on host2. -- The args of this actor contains "3" and "3000" on creation. --> <actor host="host2" function="bob" /> <argument value="3"/> <argument value="3000"/> </actor> <!-- Carole runs on 'host3', has 1 parameter "42" in its argv and one property. -- Use simgrid::s4u::Actor::get_property() to retrieve it.--> <actor host="host3" function="carol"> <argument value="42"/> <prop id="SomeProp" value="SomeValue"/> </actor> </platform>
This tag starts a new actor executing the given function on a given host.
Host on which this actor should be started (mandatory).
Code to execute.
There is nothing to do in Java, as SimGrid uses introspection abilities to retrieve the classes from their names. You must then use the full class name (including the package name) in your XML file.
Useful to delay the start of your actor.
-1 starts the actor immediately.
Time at which the actor should be killed.
-1 means that the actor should not be killed automatically.
What to do when the actor’s host is turned off and back on.
DIE(default – don’t restart the actor) or