Logo AND Algorithmique Numérique Distribuée

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