Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
7b8a9b72710c638b05e0f808508e2265e5887689
[simgrid.git] / docs / source / application.rst
1 .. _application:
2
3 .. raw:: html
4
5    <object id="TOC" data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
6    <script>
7    window.onload=function() { // Wait for the SVG to be loaded before changing it
8      var elem=document.querySelector("#TOC").contentDocument.getElementById("ApplicationBox")
9      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";
10    }
11    </script>
12    <br/>
13    <br/>
14
15 Describing your Application
16 ***************************
17
18 Every SimGrid simulation entails a distributed application, that
19 virtually executes on the simulated platform. This application can
20 be either an existing MPI program (if you use the SMPI interface), or
21 a program specifically written to execute within SimGrid, using one of
22 the dedicated APIs.
23
24 .. raw:: html
25
26    <hr/>
27
28 .. _S4U_doc:
29
30 The S4U Interface
31 =================
32
33 The S4U interface (SimGrid for you) mixes the full power of SimGrid
34 with the full power of C++. This is the prefered interface to describe
35 abstract algorithms in the domains of Cloud, P2P, HPC, IoT and similar
36 settings.
37
38 Main Concepts
39 -------------
40
41 A typical SimGrid simulation is composed of several |Actors|_, that
42 execute user-provided functions. The actors have to explicitly use the
43 S4U interface to express their
44 :ref:`computation <exhale_class_classsimgrid_1_1s4u_1_1Exec>`,
45 :ref:`communication <exhale_class_classsimgrid_1_1s4u_1_1Comm>`,
46 :ref:`disk usage <exhale_class_classsimgrid_1_1s4u_1_1Io>`,
47 and other |Activities|_, so that they get reflected within the
48 simulator. These activities take place on resources such as |Hosts|_,
49 |Links|_ and |Storages|_. SimGrid predicts the time taken by each
50 activity and orchestrates accordingly the actors waiting for the
51 completion of these activities.
52
53
54 When **communicating**, data is not directly sent to other actors but
55 posted onto a |Mailbox|_ that serve as rendez-vous point between
56 communicating actors. This means that you don't need to know who you
57 are talking to, you just put your communication `Send` request in a
58 mailbox, and it will be matched with a complementary `Receive`
59 request.  Alternatively, actors can interact through **classical
60 synchronization mechanisms** such as |Barrier|_, |Semaphore|_,
61 |Mutex|_ and |ConditionVariable|_.
62
63 Each actor is located on a simulated |Host|_. Each host is located
64 itself in a |NetZone|_, that knows the networking path between one
65 resource to another. Each NetZone is included in another one, forming
66 a tree of NetZones which root zone contains the whole platform.
67
68 The :ref:`simgrid::s4u::this_actor
69 <namespace_simgrid__s4u__this_actor>` namespace provides many helper
70 functions to simplify the code of actors.
71
72 - **Global Classes**
73
74   - :ref:`class s4u::Actor <exhale_class_classsimgrid_1_1s4u_1_1Actor>`:
75     Active entities executing your application.
76   - :ref:`class s4u::Engine <exhale_class_classsimgrid_1_1s4u_1_1Engine>`
77     Simulation engine (singleton).
78   - :ref:`class s4u::Mailbox <exhale_class_classsimgrid_1_1s4u_1_1Mailbox>`
79     Communication rendez-vous.
80
81 - **Platform Elements**
82
83   - :ref:`class s4u::Host <exhale_class_classsimgrid_1_1s4u_1_1Host>`:
84     Actor location, providing computational power.
85   - :ref:`class s4u::Link <exhale_class_classsimgrid_1_1s4u_1_1Link>`
86     Interconnecting hosts.
87   - :ref:`class s4u::NetZone <exhale_class_classsimgrid_1_1s4u_1_1NetZone>`:
88     Sub-region of the platform, containing resources (Hosts, Link, etc).
89   - :ref:`class s4u::Storage <exhale_class_classsimgrid_1_1s4u_1_1Storage>`
90     Resource on which actors can write and read data.
91   - :ref:`class s4u::VirtualMachine <exhale_class_classsimgrid_1_1s4u_1_1VirtualMachine>`:
92     Execution containers that can be moved between Hosts.
93
94 - **Activities** (:ref:`class s4u::Activity <exhale_class_classsimgrid_1_1s4u_1_1Activity>`):
95   The things that actors can do on resources
96
97   - :ref:`class s4u::Comm <exhale_class_classsimgrid_1_1s4u_1_1Comm>`
98     Communication activity, started on Mailboxes and consuming links.
99   - :ref:`class s4u::Exec <exhale_class_classsimgrid_1_1s4u_1_1Exec>`
100     Computation activity, started on Host and consuming CPU resources.
101   - :ref:`class s4u::Io <exhale_class_classsimgrid_1_1s4u_1_1Io>`
102     I/O activity, started on and consumming Storages.
103
104 - **Synchronization Mechanisms**: Classical IPC that actors can use
105
106   - :ref:`class s4u::Barrier <exhale_class_classsimgrid_1_1s4u_1_1Barrier>`
107   - :ref:`class s4u::ConditionVariable <exhale_class_classsimgrid_1_1s4u_1_1ConditionVariable>`
108   - :ref:`class s4u::Mutex <exhale_class_classsimgrid_1_1s4u_1_1Mutex>`
109   - :ref:`class s4u::Semaphore <exhale_class_classsimgrid_1_1s4u_1_1Semaphore>`
110
111
112 .. |Actors| replace:: **Actors**
113 .. _Actors: api/classsimgrid_1_1s4u_1_1Actor.html
114
115 .. |Activities| replace:: **Activities**
116 .. _Activities: api/classsimgrid_1_1s4u_1_1Activity.html
117
118 .. |Hosts| replace:: **Hosts**
119 .. _Hosts: api/classsimgrid_1_1s4u_1_1Host.html
120
121 .. |Links| replace:: **Links**
122 .. _Links: api/classsimgrid_1_1s4u_1_1Link.html
123
124 .. |Storages| replace:: **Storages**
125 .. _Storages: api/classsimgrid_1_1s4u_1_1Storage.html
126
127 .. |VirtualMachines| replace:: **VirtualMachines**
128 .. _VirtualMachines: api/classsimgrid_1_1s4u_1_1VirtualMachine.html
129
130 .. |Host| replace:: **Host**
131 .. _Host: api/classsimgrid_1_1s4u_1_1Host.html
132
133 .. |Mailbox| replace:: **Mailbox**
134 .. _Mailbox: api/classsimgrid_1_1s4u_1_1Mailbox.html
135
136 .. |NetZone| replace:: **NetZone**
137 .. _NetZone: api/classsimgrid_1_1s4u_1_1NetZone.html
138
139 .. |Barrier| replace:: **Barrier**
140 .. _Barrier: api/classsimgrid_1_1s4u_1_1Barrier.html
141
142 .. |ConditionVariable| replace:: **ConditionVariable**
143 .. _ConditionVariable: api/classsimgrid_1_1s4u_1_1ConditionVariable.html
144
145 .. |Mutex| replace:: **Mutex**
146 .. _Mutex: api/classsimgrid_1_1s4u_1_1Mutex.html
147
148
149 .. include:: app_smpi.rst
150
151 .. include:: app_legacy.rst