Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Unify on_start/on_completion signals of Activities
[simgrid.git] / docs / source / Platform_Examples.rst
1 .. raw:: html
2
3    <object id="TOC" data="graphical-toc.svg" type="image/svg+xml"></object>
4    <script>
5    window.onload=function() { // Wait for the SVG to be loaded before changing it
6      var elem=document.querySelector("#TOC").contentDocument.getElementById("ExamplesBox")
7      elem.style="opacity:0.93999999;fill:#ff0000;fill-opacity:0.1;stroke:#000000;stroke-width:0.35277778;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1";
8    }
9    </script>
10    <br/>
11    <br/>
12
13 .. _platform_examples:
14    
15 Platform Examples
16 =================
17
18 Simple Example with 3 hosts
19 ---------------------------
20
21 Imagine you want to describe a little platform with three hosts,
22 interconnected as follows:
23
24 .. image:: /tuto_smpi/3hosts.png
25    :align: center
26
27 This can be done with the following platform file, that considers the
28 simulated platform as a graph of hosts and network links.
29
30 .. literalinclude:: /tuto_smpi/3hosts.xml
31    :language: xml
32
33 The elements basic elements (with :ref:`pf_tag_host` and
34 :ref:`pf_tag_link`) are described first, and then the routes between
35 any pair of hosts are explicitly given with :ref:`pf_tag_route`. 
36
37 Any host must be given a computational speed in flops while links must
38 be given a latency and a bandwidth. You can write 1Gf for
39 1,000,000,000 flops (full list of units in the reference guide of 
40 :ref:`pf_tag_host` and :ref:`pf_tag_link`). 
41
42 Routes defined with :ref:`pf_tag_route` are symmetrical by default,
43 meaning that the list of traversed links from A to B is the same as
44 from B to A. Explicitly define non-symmetrical routes if you prefer.
45
46 The last thing you must know on SimGrid platform files is that the
47 root tag must be :ref:`pf_tag_platform`. If the ``version`` attribute
48 does not match what SimGrid expects, you will be hinted to use to the
49 ``simgrid_update_xml`` utility to update your file.
50
51 Cluster with a Crossbar
52 -----------------------
53
54 A very common parallel computing platform is a homogeneous cluster in
55 which hosts are interconnected via a crossbar switch with as many
56 ports as hosts, so that any disjoint pairs of hosts can communicate
57 concurrently at full speed. For instance:
58
59 .. literalinclude:: ../../examples/platforms/cluster_crossbar.xml
60    :language: xml
61    :lines: 1-3,18-
62
63 One specifies a name prefix and suffix for each host, and then give an
64 integer range. In the example the cluster contains 65535 hosts (!),
65 named ``node-0.simgrid.org`` to ``node-65534.simgrid.org``. All hosts
66 have the same power (1 Gflop/sec) and are connected to the switch via
67 links with same bandwidth (125 MBytes/sec) and latency (50
68 microseconds).
69
70 .. todo::
71
72    Add the picture.
73
74 Cluster with a Shared Backbone
75 ------------------------------
76
77 Another popular model for a parallel platform is that of a set of
78 homogeneous hosts connected to a shared communication medium, a
79 backbone, with some finite bandwidth capacity and on which
80 communicating host pairs can experience contention. For instance:
81
82
83 .. literalinclude:: ../../examples/platforms/cluster_backbone.xml
84    :language: xml
85    :lines: 1-3,18-
86
87 The only differences with the crossbar cluster above are the ``bb_bw``
88 and ``bb_lat`` attributes that specify the backbone characteristics
89 (here, a 500 microseconds latency and a 2.25 GByte/sec
90 bandwidth). This link is used for every communication within the
91 cluster. The route from ``node-0.simgrid.org`` to ``node-1.simgrid.org``
92 counts 3 links: the private link of ``node-0.simgrid.org``, the backbone
93 and the private link of ``node-1.simgrid.org``.
94
95 .. todo::
96
97    Add the picture.
98
99 Torus Cluster
100 -------------
101
102 Many HPC facilities use torus clusters to reduce sharing and
103 performance loss on concurrent internal communications. Modeling this
104 in SimGrid is very easy. Simply add a ``topology="TORUS"`` attribute
105 to your cluster. Configure it with the ``topo_parameters="X,Y,Z"``
106 attribute, where ``X``, ``Y`` and ``Z`` are the dimension of your
107 torus.
108
109 .. image:: ../../examples/platforms/cluster_torus.svg
110    :align: center
111
112 .. literalinclude:: ../../examples/platforms/cluster_torus.xml
113    :language: xml
114
115 Note that in this example, we used ``loopback_bw`` and
116 ``loopback_lat`` to specify the characteristics of the loopback link
117 of each node (i.e., the link allowing each node to communicate with
118 itself). We could have done so in previous example too. When no
119 loopback is given, the communication from a node to itself is handled
120 as if it were two distinct nodes: it goes twice through the private
121 link and through the backbone (if any).
122
123 Fat-Tree Cluster
124 ----------------
125
126 This topology was introduced to reduce the amount of links in the
127 cluster (and thus reduce its price) while maintaining a high bisection
128 bandwidth and a relatively low diameter. To model this in SimGrid,
129 pass a ``topology="FAT_TREE"`` attribute to your cluster. The
130 ``topo_parameters=#levels;#downlinks;#uplinks;link count`` follows the
131 semantic introduced in the `Figure 1B of this article
132 <http://webee.eedev.technion.ac.il/wp-content/uploads/2014/08/publication_574.pdf>`_.
133
134 Here is the meaning of this example: ``2 ; 4,4 ; 1,2 ; 1,2``
135
136 - That's a two-level cluster (thus the initial ``2``).
137 - Routers are connected to 4 elements below them, regardless of its
138   level. Thus the ``4,4`` component that is used as
139   ``#downlinks``. This means that the hosts are grouped by 4 on a
140   given router, and that there is 4 level-1 routers (in the middle of
141   the figure).
142 - Hosts are connected to only 1 router above them, while these routers
143   are connected to 2 routers above them (thus the ``1,2`` used as
144   ``#uplink``).
145 - Hosts have only one link to their router while every path between a
146   level-1 routers and level-2 routers use 2 parallel links. Thus the
147   ``1,2`` that is used as ``link count``.
148
149 .. image:: ../../examples/platforms/cluster_fat_tree.svg
150    :align: center
151
152 .. literalinclude:: ../../examples/platforms/cluster_fat_tree.xml
153    :language: xml
154    :lines: 1-3,10-
155
156 .. todo:
157
158    Model some other platforms, for example from https://link.springer.com/article/10.1007/s11227-019-03142-8
159
160 Dragonfly Cluster
161 -----------------
162
163 This topology was introduced to further reduce the amount of links
164 while maintaining a high bandwidth for local communications. To model
165 this in SimGrid, pass a ``topology="DRAGONFLY"`` attribute to your
166 cluster. It's based on the implementation of the topology used on
167 Cray XC systems, described in paper
168 `Cray Cascade: A scalable HPC system based on a Dragonfly network <https://dl.acm.org/citation.cfm?id=2389136>`_.
169
170 System description follows the format ``topo_parameters=#groups;#chassis;#routers;#nodes``
171 For example, ``3,4 ; 3,2 ; 3,1 ; 2``:
172
173 - ``3,4``: There are 3 groups with 4 links between each (blue level).
174   Links to nth group are attached to the nth router of the group
175   on our implementation.
176 - ``3,2``: In each group, there are 3 chassis with 2 links between each nth router
177   of each group (black level)
178 - ``3,1``: In each chassis, 3 routers are connected together with a single link
179   (green level)
180 - ``2``: Each router has two nodes attached (single link)
181
182 .. image:: ../../examples/platforms/cluster_dragonfly.svg
183    :align: center
184
185 .. literalinclude:: ../../examples/platforms/cluster_dragonfly.xml
186    :language: xml
187
188
189 .. todo:: Complete this page of the manual.
190
191    SimGrid comes with an extensive set of platforms in the
192    `examples/platforms <https://framagit.org/simgrid/simgrid/tree/master/examples/platforms>`_
193    directory that should be described here.
194