Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix an URL
[simgrid.git] / doc / doxygen / deployment.doc
1 /*! @page deployment Deploy the simulation
2
3 @tableofcontents
4
5 Once you've specified your @ref platform "virtual platform" and the
6 @ref application "application" you want to study, you must describe
7 the mapping of the application onto the platform. This page says how
8 to do that if you go for online simulation (that is, the study of a
9 program), you must say which code starts on which host, with which
10 parameters. You can also go for offline simulation, i.e. the study of
11 a trace captured from a past applicative run, as briefly explained
12 @ref XBT_replay "here".
13
14 There is two ways to specify the mapping of your program onto virtual
15 hosts: either directly from your program (with @ref MSG_process_create
16 or as in @ref s4u_ex_basics "this S4U example"), or using an external
17 XML file.  You should really logically separate your application from
18 the deployment, as it will ease your experimental campain afterward.
19 How exactly you organize your work remains up to you.
20
21 @section deploy_s4u Deployment with S4U
22
23 The following example shows the several ways of doing so in the S4U
24 interface: @ref examples/s4u/actor-create/s4u_actor-create.cpp.
25 Associated XML file: @ref examples/s4u/actor-create/s4u_actor-create_d.xml
26
27 @section deploy_msg Deployment with MSG
28
29 If you're stuck with the MSG interface, then you should simply use one
30 of the following functions to start new actors onto your virtual
31 hosts: @ref MSG_process_create, @ref MSG_process_create_with_arguments
32 or @ref MSG_process_create_with_environment. These functions are used
33 in many of the provided example, just grep for them.
34
35 @section deploy_xml Deployment with XML
36
37 Deploying actors from XML is easy. This section presents a complete
38 example and the reference guide of the involved tags.
39
40 The deployment file looks just like a @ref platform "platform" file,
41 with only 3 tags used:
42
43   - @c <actor> starts a new actor on a given host;
44   - @c <argument> passes a given argument in the argv of an actor
45     (the list of arguments is ordered);
46   - @c <prop> adds a property to the actor.
47
48 @subsection deploy_xml_ex Examples
49
50 To make them easy to find, almost all deployment files in the archive
51 are named @c ***_d_xml.
52
53 @verbatim
54 <?xml version='1.0'?>
55 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd">
56 <platform version="4">
57   <!-- Alice, which runs on the machine named 'host1', does not take any parameter -->
58   <actor host="host1" function="alice" />
59
60   <!-- Bob, which runs on 'host2', has 2 parameters "3" and "3000" in its argv -->
61   <actor host="host2" function="bob" />
62      <argument value="3"/>
63      <argument value="3000"/>
64   </actor>
65
66   <!-- Carole runs on 'host3', has 1 parameter "42" in its argv and one property -->
67   <!-- See MSG_process_get_property_value() to retrieve this property -->
68   <actor host="host3" function="carole">
69       <argument value="42"/>
70       <prop id="SomeProp" value="SomeValue"/>
71   </actor>
72 </platform>
73 @endverbatim
74
75 @subsection deploy_xml_actor The actor tag
76
77 &lt;actor&gt; starts a new actor on a given host. It specifies which
78 function (from your application) gets executed on the host. Hence, the
79 @c host and @c function attributes are mandatory, but this tag accepts
80 some optional attributes too.
81
82 | Attribute name  | Mandatory | Values       | Description                                                                     |
83 | --------------- | --------- | ------------ | -----------                                                                     |
84 | host            | yes       | String       | This must match the name of an host defined in the platform file.               |
85 | function        | yes       | String       | Name of the function (from your own code) that will be executed.  See @ref deploy_xml_functions. |
86 | start_time      | no        | int          | The simulated time when this actor will be started (Default: ASAP).             |
87 | kill_time       | no        | int          | The simulated time when this actor will be forcefully stopped (Default: never). |
88 | on_failure      | no        | DIE\|RESTART | What should be done when the actor fails (Default: die).       |
89
90 @subsection deploy_xml_argument The argument tag
91
92 This tag (which must be enclosed in a @c &lt;actor&gt; tag) adds a
93 new string to the parameter list received by your actor (either its @c
94 argv array in MSG or its @c args vector in S4U).  Naturally, the
95 semantic of these parameters completely depend on your program.
96
97 | Attribute name  | Mandatory | Values                 | Description             |
98 | --------------- | --------- | ---------------------- | -----------             |
99 | value           | yes       | String                 | Value of this parameter |
100
101 @subsection deploy_xml_prop The prop tag
102
103 This tag (which must be enclosed in a @c &lt;actor&gt; tag) adds a new
104 property to your actor. You can retrieve these properties with
105 MSG_process_get_property_value() or simgrid::s4u::Actor::property().
106 Naturally, the semantic of these parameters completely depend on your
107 program.
108
109 | Attribute name  | Mandatory | Values                 | Description                  |
110 | --------------- | --------- | ---------------------- | -----------                  |
111 | id              | yes       | String                 | Name of the defined property |
112 | value           | yes       | String                 | Value of this property       |
113
114 @subsection deploy_xml_functions Declaring startable functions
115
116 You need to connect your code to the names that you use in the XML
117 deployment file. Depending on the interface you use, this is done with
118 MSG_process_create() or simgrid::s4u::Engine::registerFunction().
119 There is nothing to do in your **Java code** since SimGrid uses
120 the Java introspection abilities to retrieve the classes from their
121 names. In your XML file, you must then use the full class name
122 (including the package name).
123
124 */