Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
83c8aab609b05995f5e2ed88947ca0ca0049e66a
[simgrid.git] / doc / doxygen / platform.doc
1 /*! @page platform Describing the virtual platform
2
3
4 @section pf_res Resource description
5
6 @subsection pf_res_computing Computing Resources
7
8 @subsubsection pf_cabinet <cabinet>
9
10 @note
11     This tag is only available when the routing mode of the network zone
12     is set to ``Cluster``.
13
14 The ``<cabinet />`` tag is, like the @ref pf_tag_cluster "<cluster>" tag,
15 a meta-tag. This means that it is simply a shortcut for creating a set of (homogeneous) hosts and links quickly;
16 unsurprisingly, this tag was introduced to setup cabinets in data centers quickly. Unlike
17 <cluster>, however, the <cabinet> assumes that you create the backbone
18 and routers yourself; see our examples below.
19
20 #### Attributes ####
21
22 Attribute name  | Mandatory | Values | Description
23 --------------- | --------- | ------ | -----------
24 id              | yes       | string | The identifier of the cabinet. Facilitates referring to this cluster.
25 prefix          | yes       | string | Each node of the cabinet has to have a name. This name will be prefixed with this prefix.
26 suffix          | yes       | string | Each node of the cabinet will be suffixed with this suffix
27 radical         | yes       | string | Regexp used to generate cabinet nodes name. Syntax: "10-20" will give you 11 machines numbered from 10 to 20, "10-20;2" will give you 12 machines, one with the number 2, others numbered as before. The produced number is concatenated between prefix and suffix to form machine names.
28 speed           | yes       | int    | Same as the ``speed`` attribute of the @ref pf_tag_host "<host>" tag.
29 bw              | yes       | int    | Bandwidth for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
30 lat             | yes       | int    | Latency for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
31
32 @note
33     Please note that as of now, it is impossible to change attributes such as,
34     amount of cores (always set to 1), the sharing policy of the links (always set to @ref pf_sharing_policy_splitduplex "SPLITDUPLEX").
35
36 #### Example ####
37
38 The following example was taken from ``examples/platforms/meta_cluster.xml`` and
39 shows how to use the cabinet tag.
40
41 @verbatim
42   <zone  id="my_cluster1"  routing="Cluster">
43     <cabinet id="cabinet1" prefix="host-" suffix=".cluster1"
44       speed="1Gf" bw="125MBps" lat="100us" radical="1-10"/>
45     <cabinet id="cabinet2" prefix="host-" suffix=".cluster1"
46       speed="1Gf" bw="125MBps" lat="100us" radical="11-20"/>
47     <cabinet id="cabinet3" prefix="host-" suffix=".cluster1"
48       speed="1Gf" bw="125MBps" lat="100us" radical="21-30"/>
49
50     <backbone id="backbone1" bandwidth="2.25GBps" latency="500us"/>
51   </zone>
52 @endverbatim
53
54 @note
55    Please note that you must specify the @ref pf_backbone "&lt;backbone&gt;"
56    tag by yourself; this is not done automatically and there are no checks
57    that ensure this backbone was defined.
58
59 The hosts generated in the above example are named host-1.cluster, host-2.cluster1
60 etc.
61
62
63 @subsection pf_ne Network equipment
64
65 There are two tags at all times available to represent network entities and
66 several other tags that are available only in certain contexts.
67 1. ``<link>``:
68
69
70 3. ``<backbone/>``: This tag is only available when the containing network zone is
71                     used as a cluster (i.e., mode="Cluster")
72
73 @remark
74     If you want to represent an entity like a switch, you must use ``<link>`` (see section). Routers are used
75     to run some routing algorithm and determine routes (see Section @ref pf_routing for details).
76
77 @subsubsection pf_backbone <backbone/>
78
79 @note
80   This tag is <b>only available</b> when the containing network zone uses the "Cluster" routing mode!
81
82 Using this tag, you can designate an already existing link to be a backbone.
83
84 Attribute name  | Mandatory | Values | Description
85 --------------- | --------- | ------ | -----------
86 id              | yes       | string | Name of the link that is supposed to act as a backbone.
87
88
89
90 @section pf_routing Routing
91
92
93 @subsubsection pf_routing_model_simple Simple/fast models
94
95 | Name                                     | Description                                                                                                                         |
96 | ---------------------------------------- | ------------------------------------------------------------------------------                                                      |
97 | @ref pf_routing_model_cluster "Cluster"  | This is specific to the @ref pf_tag_cluster "&lt;cluster/&gt;" tag and should not be used by the user, as several assumptions are made. |
98 | @ref pf_routing_model_none    "None"     | No routing at all. Unless you know what you're doing, avoid using this mode in combination with a non-constant network model.       |
99 | @ref pf_routing_model_vivaldi "Vivaldi"  | Perfect when you want to use coordinates. Also see the corresponding @ref pf_P2P_tags "P2P section" below.                          |
100
101 @anchor pf_routing_model_cluster
102 ### Cluster ###
103
104 @note
105  In this mode, the @ref pf_cabinet "&lt;cabinet/&gt;" tag is available.
106
107 #### Example platform files ####
108
109 This is an automatically generated list of example files that use the Cluster
110 routing model (the path is given relative to SimGrid's source directory):
111
112 @verbinclude example_filelist_routing_cluster
113
114 @anchor pf_routing_model_none
115
116 ### None ###
117
118 This model does exactly what it's name advertises: Nothing. There is no routing
119 available within this model and if you try to communicate within the zone that
120 uses this model, SimGrid will fail unless you have explicitly activated the
121 @ref options_model_select_network_constant "Constant Network Model" (this model charges
122 the same for every single communication). It should
123 be noted, however, that you can still attach an @ref pf_tag_zoneroute "ZoneRoute",
124 as is demonstrated in the example below:
125
126 @verbinclude platforms/cluster_and_one_host.xml
127
128 #### Example platform files ####
129
130 This is an automatically generated list of example files that use the None
131 routing model (the path is given relative to SimGrid's source directory):
132
133 @verbinclude example_filelist_routing_none
134
135
136
137
138 @anchor pf_routing_model_vivaldi
139 ### Vivaldi ###
140
141 For more information on how to use the [Vivaldi Coordinates](https://en.wikipedia.org/wiki/Vivaldi_coordinates),
142 see also Section @ref pf_P2P_tags "P2P tags".
143
144 Note that it is possible to combine the Vivaldi routing model with other routing models;
145 an example can be found in the file @c examples/platforms/cloud.xml. This
146 examples models a NetZone using Vivaldi that contains other NetZones that use different
147 routing models.
148
149 #### Example platform files ####
150
151 This is an automatically generated list of example files that use the None
152 routing model (the path is given relative to SimGrid's source directory):
153
154 @verbinclude example_filelist_routing_vivaldi
155
156
157 @subsection ps_dec Defining routes
158
159 There are currently four different ways to define routes:
160
161 | Name                                              | Description                                                                         |
162 | ------------------------------------------------- | ----------------------------------------------------------------------------------- |
163 | @ref pf_tag_route "route"                 | Used to define route between host/router                                            |
164 | @ref pf_tag_zoneroute "zoneRoute"             | Used to define route between different zones                                           |
165 | @ref pf_tag_bypassroute "bypassRoute"     | Used to supersede normal routes as calculated by the network model between host/router; e.g., can be used to use a route that is not the shortest path for any of the shortest-path routing models. |
166 | @ref pf_tag_bypassasroute "bypassZoneRoute"  | Used in the same way as bypassRoute, but for zones                                     |
167
168 Basically all those tags will contain an (ordered) list of references
169 to link that compose the route you want to define.
170
171 Consider the example below:
172
173 @subsubsection pf_tag_bypassasroute bypasszoneroute
174
175 As said before, once you choose
176 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
177 define some of your routes, which will be specific. You may also want
178 to bypass some routes defined in lower level zone at an upper stage:
179 <b>bypasszoneroute</b> is the tag you're looking for. It allows one to
180 bypass routes defined between already defined between zone (if you want
181 to bypass route for a specific host, you should just use byPassRoute).
182 The principle is the same as zoneroute: <b>bypasszoneroute</b> contains
183 list of links that are in the path between src and dst.
184
185 #### Attributes ####
186
187 | Attribute name  | Mandatory | Values                  | Description                                                                                                  |
188 | --------------- | --------- | ----------------------  | -----------                                                                                                  |
189 | src             | yes       | String                  | The value given to the source zone's "id" attribute                                                            |
190 | dst             | yes       | String                  | The value given to the destination zone's "id" attribute.                                                      |
191 | gw_src          | yes       | String                  | The value given to the source gateway's "id" attribute; this can be any host or router within the src zone     |
192 | gw_dst          | yes       | String                  | The value given to the destination gateway's "id" attribute; this can be any host or router within the dst zone|
193 | symmetrical     | no        | YES@| NO (Default: YES) | If this route is symmetric, the opposite route (from dst to src) will also be declared implicitly. |
194
195 #### Example ####
196
197 @verbatim
198 <bypasszoneRoute src="my_cluster_1" dst="my_cluster_2"
199   gw_src="my_cluster_1_router"
200   gw_dst="my_cluster_2_router">
201     <link_ctn id="link_tmp"/>
202 </bypasszoneroute>
203 @endverbatim
204
205 This example shows that link @c link_tmp (definition not displayed here) directly
206 connects the router @c my_cluster_1_router in the source cluster to the router
207 @c my_cluster_2_router in the destination router. Additionally, as the @c symmetrical
208 attribute was not given, this route is presumed to be symmetrical.
209
210 @subsubsection pf_tag_bypassroute bypassRoute
211
212 As said before, once you choose
213 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
214 define some of your routes, which will be specific. You may also want
215 to bypass some routes defined in lower level zone at an upper stage:
216 <b>bypassRoute</b> is the tag you're looking for. It allows one to bypass
217 routes defined between <b>host/router</b>. The principle is the same
218 as route: <b>bypassRoute</b> contains list of links references of
219 links that are in the path between src and dst.
220
221 #### Attributes ####
222
223 | Attribute name  | Mandatory | Values                  | Description                                                                                                  |
224 | --------------- | --------- | ----------------------  | -----------                                                                                                  |
225 | src             | yes       | String                  | The value given to the source zone's "id" attribute                                                            |
226 | dst             | yes       | String                  | The value given to the destination zone's "id" attribute.                                                      |
227 | symmetrical     | no        | YES @| NO (Default: YES) | If this route is symmetric, the opposite route (from dst to src) will also be declared implicitly. |
228
229 #### Examples ####
230
231 @verbatim
232 <bypassRoute src="host_1" dst="host_2">
233    <link_ctn id="link_tmp"/>
234 </bypassRoute>
235 @endverbatim
236
237 This example shows that link @c link_tmp (definition not displayed here) directly
238 connects host @c host_1 to host @c host_2. Additionally, as the @c symmetrical
239 attribute was not given, this route is presumed to be symmetrical.
240
241 @section pf_other Other tags
242
243 The following tags can be used inside a @<platform@> tag even if they are not
244 directly describing the platform:
245
246   - @ref pf_tag_config passes configuration options, e.g. to change the network model;
247   - @ref pf_tag_prop gives user-defined properties to various elements
248
249 @subsection pf_trace trace and trace_connect
250
251 Both tags are an alternate way to pass files containing information on
252 availability, state etc. to an entity. (See also @ref howto_churn).
253 Instead of referring to the file directly in the host, link, or
254 cluster tag, you proceed by defining a trace with an id corresponding
255 to a file, later a host/link/cluster, and finally using trace_connect
256 you say that the file trace must be used by the entity.
257
258
259 #### Example ####
260
261 @verbatim
262 <zone  id="zone0"  routing="Full">
263   <host id="bob" speed="1000000000"/>
264 </zone>
265 <trace id="myTrace" file="bob.trace" periodicity="1.0"/>
266 <trace_connect trace="myTrace" element="bob" kind="POWER"/>
267 @endverbatim
268
269 @note
270     The order here is important.  @c trace_connect must come
271     after the elements @c trace and @c host, as both the host
272     and the trace definition must be known when @c trace_connect
273     is parsed; the order of @c trace and @c host is arbitrary.
274
275
276 #### @c trace attributes ####
277
278
279 | Attribute name  | Mandatory | Values                 | Description                                                                                       |
280 | --------------- | --------- | ---------------------- | -----------                                                                                       |
281 | id              | yes       | String                 | Identifier of this trace; this is the name you pass on to @c trace_connect.                       |
282 | file            | no        | String                 | Filename of the file that contains the information - the path must follow the style of your OS. You can omit this, but then you must specify the values inside of &lt;trace&gt; and &lt;/trace&gt; - see the example below. |
283 | trace_periodicity | yes | String | This is the same as for @ref pf_tag_host "hosts" (see there for details) |
284
285 Here is an example  of trace when no file name is provided:
286
287 @verbatim
288  <trace id="myTrace" periodicity="1.0">
289     0.0 1.0
290     11.0 0.5
291     20.0 0.8
292  </trace>
293 @endverbatim
294
295 #### @c trace_connect attributes ####
296
297 | Attribute name  | Mandatory | Values                 | Description                                                                                       |
298 | --------------- | --------- | ---------------------- | -----------                                                                                       |
299 | kind            | no        | HOST_AVAIL@|POWER@|<br/>LINK_AVAIL@|BANDWIDTH@|LATENCY (Default: HOST_AVAIL)   | Describes the kind of trace.                   |
300 | trace           | yes       | String                 | Identifier of the referenced trace (specified of the trace's @c id attribute)                     |
301 | element         | yes       | String                 | The identifier of the referenced entity as given by its @c id attribute                           |
302
303 @section pf_hints Hints, tips and frequently requested features
304
305 Now you should know at least the syntax and be able to create a
306 platform by your own. However, after having ourselves wrote some platforms, there
307 are some best practices you should pay attention to in order to
308 produce good platform and some choices you can make in order to have
309 faster simulations. Here's some hints and tips, then.
310
311 @subsection pf_hints_search Finding the platform example that you need
312
313 Most platform files that we ship are in the @c examples/platforms
314 folder. The good old @c grep tool can find the examples you need when
315 wondering on a specific XML tag. Here is an example session searching
316 for @ref pf_trace "trace_connect":
317
318 @verbatim
319 % cd examples/platforms
320 % grep -R -i -n --include="*.xml" "trace_connect" .
321 ./two_hosts_platform_with_availability_included.xml:26:<trace_connect kind="SPEED" trace="A" element="Cpu A"/>
322 ./two_hosts_platform_with_availability_included.xml:27:<trace_connect kind="HOST_AVAIL" trace="A_failure" element="Cpu A"/>
323 ./two_hosts_platform_with_availability_included.xml:28:<trace_connect kind="SPEED" trace="B" element="Cpu B"/>
324 ./two_hosts.xml:17:  <trace_connect trace="Tremblay_power" element="Tremblay" kind="SPEED"/>
325 @endverbatim
326
327 @subsection pf_hint_generating How to generate different platform files?
328
329 This is actually a good idea to search for a better platform file,
330 that better fit the need of your study. To be honest, the provided
331 examples are not representative of anything. They exemplify our XML
332 syntax, but that's all. small_platform.xml for example was generated
333 without much thought beyond that.
334
335 The best thing to do when possible is to write your own platform file,
336 that model the platform on which you run your code. For that, you
337 could use <a href="https://gitlab.inria.fr/simgrid/platform-calibration">our
338 calibration scripts</a>. This leads to very good fits between the
339 platform, the model and the needs.  The g5k.xml example resulted of
340 such an effort, which also lead to <a href="https://github.com/lpouillo/topo5k/">an
341 ongoing attempt</a> to automatically extract the SimGrid platform from
342 the <a href="http://grid5000.fr/">Grid'5000</a> experimental platform.
343 But it's hard to come up with generic models. Don't take these files
344 too seriously. Actually, you should always challenge our models and
345 your instantiation if the accuracy really matters to you (see <a
346 href="https://hal.inria.fr/hal-00907887">this discussion</a>).
347
348 But such advices only hold if you have a real platform and a real
349 application at hand. It's moot for more abstract studies working on
350 ideas and algorithms instead of technical artefacts. Well, in this
351 case, there unfortunately is nothing better than this old and rusty
352 <a href="http://pda.gforge.inria.fr/tools/download.html">simulacrum</a>.
353 This project is dormant since over 10 years (and you will have to
354 update the generated platforms with <tt>bin/simgrid_update_xml</tt> to
355 use them), but that's the best we have for this right now....
356
357 @subsection pf_zone_h Zone Hierarchy
358 The network zone design allows SimGrid to go fast, because computing route is
359 done only for the set of resources defined in the current zone. If you're using
360 only a big zone containing all resource with no zone into it and you're
361 using Full model, then ... you'll loose all interest into it. On the
362 other hand, designing a binary tree of zone with, at the lower level,
363 only one host, then you'll also loose all the good zone hierarchy can
364 give you. Remind you should always be "reasonable" in your platform
365 definition when choosing the hierarchy. A good choice if you try to
366 describe a real life platform is to follow the zone described in
367 reality, since this kind of trade-off works well for real life
368 platforms.
369
370 @subsection pf_exit_zone Exit Zone: why and how
371 Users that have looked at some of our platforms may have notice a
372 non-intuitive schema ... Something like that:
373
374
375 @verbatim
376 <zone id="zone_4"  routing="Full">
377 <zone id="exitzone_4"  routing="Full">
378         <router id="router_4"/>
379 </zone>
380 <cluster id="cl_4_1" prefix="c_4_1-" suffix="" radical="1-20" speed="1000000000" bw="125000000" lat="5E-5" bb_bw="2250000000" bb_lat="5E-4"/>
381 <cluster id="cl_4_2" prefix="c_4_2-" suffix="" radical="1-20" speed="1000000000" bw="125000000" lat="5E-5" bb_bw="2250000000" bb_lat="5E-4"/>
382 <link id="4_1" bandwidth="2250000000" latency="5E-5"/>
383 <link id="4_2" bandwidth="2250000000" latency="5E-5"/>
384 <link id="bb_4" bandwidth="2250000000" latency="5E-4"/>
385 <zoneroute src="cl_4_1"
386         dst="cl_4_2"
387         gw_src="c_4_1-cl_4_1_router"
388         gw_dst="c_4_2-cl_4_2_router">
389                 <link_ctn id="4_1"/>
390                 <link_ctn id="bb_4"/>
391                 <link_ctn id="4_2"/>
392 </zoneroute>
393 <zoneroute src="cl_4_1"
394         dst="exitzone_4"
395         gw_src="c_4_1-cl_4_1_router"
396         gw_dst="router_4">
397                 <link_ctn id="4_1"/>
398                 <link_ctn id="bb_4"/>
399 </zoneroute>
400 <zoneroute src="cl_4_2"
401         dst="exitzone_4"
402         gw_src="c_4_2-cl_4_2_router"
403         gw_dst="router_4">
404                 <link_ctn id="4_2"/>
405                 <link_ctn id="bb_4"/>
406 </zoneroute>
407 </zone>
408 @endverbatim
409
410 In the zone_4, you have an exitzone_4 defined, containing only one router,
411 and routes defined to that zone from all other zone (as cluster is only a
412 shortcut for a zone, see cluster description for details). If there was
413 an upper zone, it would define routes to and from zone_4 with the gateway
414 router_4. It's just because, as we did not allowed (for performances
415 issues) to have routes from a zone to a single host/router, you have to
416 enclose your gateway, when you have zone included in your zone, within a
417 zone to define routes to it.
418
419 @subsection pf_routing_howto_choose_wisely Choosing wisely the routing model to use
420
421
422 Choosing wisely the routing model to use can significantly fasten your
423 simulation/save your time when writing the platform/save tremendous
424 disk space. Here is the list of available model and their
425 characteristics (lookup: time to resolve a route):
426
427 @li <b>Full</b>: Full routing data (fast, large memory requirements,
428     fully expressive)
429 @li <b>Floyd</b>: Floyd routing data (slow initialization, fast
430     lookup, lesser memory requirements, shortest path routing only).
431     Calculates all routes at once at the beginning.
432 @li <b>Dijkstra</b>: Dijkstra routing data (fast initialization, slow
433     lookup, small memory requirements, shortest path routing only).
434     Calculates a route when necessary.
435 @li <b>DijkstraCache</b>: Dijkstra routing data (fast initialization,
436     fast lookup, small memory requirements, shortest path routing
437     only). Same as Dijkstra, except it handles a cache for latest used
438     routes.
439 @li <b>None</b>: No routing (usable with Constant network only).
440     Defines that there is no routes, so if you try to determine a
441     route without constant network within this zone, SimGrid will raise
442     an exception.
443 @li <b>Vivaldi</b>: Vivaldi routing, so when you want to use coordinates
444 @li <b>Cluster</b>: Cluster routing, specific to cluster tag, should
445     not be used.
446
447 @subsection pf_loopback I want to specify the characteristics of the loopback link!
448
449 Each routing model automatically adds a loopback link for each declared host, i.e.,
450 a network route from the host to itself, if no such route is declared in the XML
451 file. This default link has a bandwidth of 498 Mb/s, a latency of 15 microseconds,
452 and is <b>not</b> shared among network flows.
453
454 If you want to specify the characteristics of the loopback link for a given host, you
455 just have to specify a route from this host to itself with the desired characteristics
456 in the XML file. This will prevent the routing model to add and use the default
457 loopback link.
458
459 @subsection pf_switch I want to describe a switch but there is no switch tag!
460
461 Actually we did not include switch tag. But when you're trying to
462 simulate a switch, assuming
463 fluid bandwidth models are used (which SimGrid uses by default unless
464 ns-3 or constant network models are activated), the limiting factor is
465 switch backplane bandwidth. So, essentially, at least from
466 the simulation perspective, a switch is similar to a
467 link: some device that is traversed by flows and with some latency and
468 so,e maximum bandwidth. Thus, you can simply simulate a switch as a
469 link. Many links
470 can be connected to this "switch", which is then included in routes just
471 as a normal link.
472
473
474 @subsection pf_multicabinets I want to describe multi-cabinets clusters!
475
476 You have several possibilities, as usual when modeling things. If your
477 cabinets are homogeneous and the intercabinet network negligible for
478 your study, you should just create a larger cluster with all hosts at
479 the same layer.
480
481 In the rare case where your hosts are not homogeneous between the
482 cabinets, you can create your cluster completely manually. For that,
483 create an As using the Cluster routing, and then use one
484 &lt;cabinet&gt; for each cabinet. This cabinet tag can only be used an
485 As using the Cluster routing schema, and creating
486
487 Be warned that creating a cluster manually from the XML with
488 &lt;cabinet&gt;, &lt;backbone&gt; and friends is rather tedious. The
489 easiest way to retrieve some control of your model without diving into
490 the &lt;cluster&gt; internals is certainly to create one separate
491 &lt;cluster&gt; per cabinet and interconnect them together. This is
492 what we did in the G5K example platform for the Graphen cluster.
493
494 @subsection pf_platform_multipath I want to express multipath routing in platform files!
495
496 It is unfortunately impossible to express the fact that there is more
497 than one routing path between two given hosts. Let's consider the
498 following platform file:
499
500 @verbatim
501 <route src="A" dst="B">
502    <link_ctn id="1"/>
503 </route>
504 <route src="B" dst="C">
505   <link_ctn id="2"/>
506 </route>
507 <route src="A" dst="C">
508   <link_ctn id="3"/>
509 </route>
510 @endverbatim
511
512 Although it is perfectly valid, it does not mean that data traveling
513 from A to C can either go directly (using link 3) or through B (using
514 links 1 and 2). It simply means that the routing on the graph is not
515 trivial, and that data do not following the shortest path in number of
516 hops on this graph. Another way to say it is that there is no implicit
517 in these routing descriptions. The system will only use the routes you
518 declare (such as &lt;route src="A" dst="C"&gt;&lt;link_ctn
519 id="3"/&gt;&lt;/route&gt;), without trying to build new routes by aggregating
520 the provided ones.
521
522 You are also free to declare platform where the routing is not
523 symmetrical. For example, add the following to the previous file:
524
525 @verbatim
526 <route src="C" dst="A">
527   <link_ctn id="2"/>
528   <link_ctn id="1"/>
529 </route>
530 @endverbatim
531
532 This makes sure that data from C to A go through B where data from A
533 to C go directly. Don't worry about realism of such settings since
534 we've seen ways more weird situation in real settings (in fact, that's
535 the realism of very regular platforms which is questionable, but
536 that's another story).
537
538 */