Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Spelling fixes & a few cases of polishing the English (#329)
[simgrid.git] / docs / source / Introduction.rst
1 .. _intro_concepts:
2
3 Main Concepts
4 =============
5
6
7 .. raw:: html
8
9    <object data="graphical-toc.svg" width="100%" type="image/svg+xml"></object>
10    <br/>
11    <br/>
12
13 Introduction
14 ============
15
16 Typical Study based on SimGrid
17 ------------------------------
18
19 Any SimGrid study entails the following components:
20
21  - The studied **Application**. This can be either a distributed
22    algorithm described in our simple APIs, or a full featured real
23    parallel application using for example the MPI interface
24    :ref:`(more info) <application>`.
25
26  - The **Simulated Platform**. This is a description of a given
27    distributed system (machines, links, disks, clusters, etc). Most of
28    the platform files are written in XML although a Lua interface is
29    under development.  SimGrid makes it easy to augment the Simulated
30    Platform with a Dynamic Scenario where for example the links are
31    slowed down (because of external usage) or the machines fail. You
32    even have support to specify the applicative workload that you want
33    to feed to your application
34    :ref:`(more info) <platform>`.
35
36  - The application's **Deployment Description**. In SimGrid
37    terminology, the application is an inert set of source files and
38    binaries. To make it run, you have to describe how your application
39    should be deployed on the simulated platform. You need to specify
40    which process is mapped onto which machine, along with their parameters
41    :ref:`(more info) <scenario>`.
42
43  - The **Platform Models**. They describe how the simulated platform
44    reacts to the actions of the application. For example, they compute
45    the time taken by a given communication on the simulated platform.
46    These models are already included in SimGrid, and you only need to
47    pick one and maybe tweak its configuration to get your results
48    :ref:`(more info) <models>`.
49
50 These components are put together to run a **simulation**, that is an
51 experiment or a probe. The result of one or many simulation provides
52 an **outcome** (logs, visualization, or statistical analysis) that help
53 answering the **question** targeted by this study.
54
55 Here are some questions on which SimGrid is particularly relevant:
56
57  - **Compare an Application to another**. This is the classical use
58    case for scientists, who use SimGrid to test how the solution that
59    they contribute to compares to the existing solutions from the
60    literature.
61
62  - **Design the best [Simulated] Platform for a given Application.**
63    Tweaking the platform file is much easier than building a new real
64    platform for testing purpose. SimGrid also allows for the co-design 
65    of the platform and the application by modifying both of them.
66
67  - **Debug Real Applications**. With real systems, is sometimes
68    difficult to reproduce the exact run leading to the bug that you
69    are tracking. With SimGrid, you are *clairvoyant* about your
70    *reproducible experiments*: you can explore every part of the
71    system, and your probe will not change the simulated state. It also
72    makes it easy to mock some parts of the real system that are not
73    under study.
74
75 Depending on the context, you may see some parts of this process as
76 less important, but you should pay close attention if you want to be
77 confident in the results coming out of your simulations. In
78 particular, you should not blindly trust your results but always
79 strive to double-check them. Likewise, you should question the realism
80 of your input configuration, and we even encourage you to doubt (and
81 check) the provided performance models.
82
83 To ease such questioning, you really should logically separate these
84 parts in your experimental setup. It is seen as a very bad practice to
85 merge the application, the platform, and the deployment all together.
86 SimGrid is versatile and your mileage may vary, but you should start
87 with your Application specified as a C++ or Java program, using one of
88 the provided XML platform file, and with your deployment in a separate
89 XML file.
90
91 SimGrid Execution Modes
92 -----------------------
93
94 Depending on the intended study, SimGrid can be run in several execution modes.
95
96 **Simulation Mode**. This is the most common execution mode, where you want
97 to study how your application behaves on the simulated platform under
98 the experimental scenario.
99
100 In this mode, SimGrid can provide information about the time taken by
101 your application, the amount of energy dissipated by the platform to
102 run your application, and the detailed usage of each resource.
103
104 **Model-Checking Mode**. This can be seen as a sort of exhaustive
105 testing mode, where every possible outcome of your application is
106 explored. In some sense, this mode tests your application for all
107 possible platforms that you could imagine (and more).
108
109 You just provide the application and its deployment (number of
110 processes and parameters), and the model checker will literally
111 explore all possible outcomes by testing all possible message
112 interleavings: if at some point a given process can either receive the
113 message A first or the message B depending on the platform
114 characteristics, the model checker will explore the scenario where A
115 arrives first, and then rewind to the same point to explore the
116 scenario where B arrives first.
117
118 This is a very powerful mode, where you can evaluate the correctness of
119 your application. It can verify either **safety properties** (asserts)
120 or **liveness properties** stating for example that if a given event
121 occurs, then another given event will occur in a finite amount of
122 steps. This mode is not only usable with the abstract algorithms
123 developed on top of the SimGrid APIs, but also with real MPI
124 applications (to some extent).
125
126 The main limit of Model Checking lies in the huge amount of scenarios
127 to explore. SimGrid tries to explore only non-redundant scenarios
128 thanks to classical reduction techniques (such as DPOR and stateful
129 exploration) but the exploration may well never finish if you don't
130 carefully adapt your application to this mode.
131
132 A classical trap is that the Model Checker can only verify whether
133 your application fits the properties provided, which is useless if you
134 have a bug in your property. Remember also that one way for your
135 application to never violate a given assert is to not start at all,
136 because of a stupid bug.
137
138 Another limit of this mode is that it does not use the performance
139 models of the simulation mode. Time becomes discrete: You can say for
140 example that the application took 42 steps to run, but there is no way
141 to know how much time it took or the amount of watts that were dissipated.
142
143 Finally, the model checker only explores the interleavings of
144 computations and communications. Other factors such as thread
145 execution interleaving are not considered by the SimGrid model
146 checker.
147
148 The model checker may well miss existing issues, as it computes the
149 possible outcomes *from a given initial situation*. There is no way to
150 prove the correctness of your application in full generality with this
151 tool.
152
153 **Benchmark Recording Mode**. During debug sessions, continuous
154 integration testing, and other similar use cases, you are often only
155 interested in the control flow. If your application applies filters to
156 huge images split into small blocks, the filtered image is probably not
157 what you are interested in. You are probably looking for a way to run
158 each computational kernel only once, and record the time it takes to cache it.
159 This code block can then be skipped in simulation
160 and replaced by a synthetic block using the cached information. The
161 simulated platform will take this block into account without requesting
162 the actual hosting machine to benchmark it.
163
164 SimGrid Limits
165 --------------
166
167 This framework is by no means the holly grail, able to solve
168 every problem on Earth.
169
170 **SimGrid scope is limited to distributed systems.** Real-time
171 multi-threaded systems are out of this scope. You could probably tweak
172 SimGrid for such studies (or the framework could possibly be extended
173 in this direction), but another framework specifically targeting such a
174 use case would probably be more suited.
175
176 **There is currently no support for wireless networks**.
177 The framework could certainly be improved in this direction, but this
178 still has to be done.
179
180 **There is no perfect model, only models adapted to your study.** The SimGrid
181 models target fast and large studies, and yet they target realistic results. In
182 particular, our models abstract away parameters and phenomena that are often
183 irrelevant to reality in our context.
184
185 SimGrid is obviously not intended for a study of any phenomenon that our
186 abstraction removes. Here are some **studies that you should not do with
187 SimGrid**:
188
189  - Studying the effect of L3 vs. L2 cache effects on your application
190  - Comparing kernel schedulers and policies
191  - Comparing variants of TCP
192  - Exploring pathological cases where TCP breaks down, resulting in
193    abnormal executions.
194  - Studying security aspects of your application, in presence of
195    malicious agents.
196
197 SimGrid Success Stories
198 -----------------------
199
200 SimGrid was cited in over 1,500 scientific papers (according to Google
201 Scholar). Among them
202 `over 200 publications <https://simgrid.org/Usages.html>`_
203 (written by about 300 individuals) use SimGrid as a scientific
204 instrument to conduct their experimental evaluation. These
205 numbers do not include the articles contributing to SimGrid.
206 This instrument was used in many research communities, such as
207 `High-Performance Computing <https://hal.inria.fr/inria-00580599/>`_,
208 `Cloud Computing <http://dx.doi.org/10.1109/CLOUD.2015.125>`_,
209 `Workflow Scheduling <http://dl.acm.org/citation.cfm?id=2310096.2310195>`_,
210 `Big Data <https://hal.inria.fr/hal-01199200/>`_ and
211 `MapReduce <http://dx.doi.org/10.1109/WSCAD-SSC.2012.18>`_,
212 `Data Grid <http://ieeexplore.ieee.org/document/7515695/>`_,
213 `Volunteer Computing <http://www.sciencedirect.com/science/article/pii/S1569190X17301028>`_,
214 `Peer-to-Peer Computing <https://hal.archives-ouvertes.fr/hal-01152469/>`_,
215 `Network Architecture <http://dx.doi.org/10.1109/TPDS.2016.2613043>`_,
216 `Fog Computing <http://ieeexplore.ieee.org/document/7946412/>`_, or
217 `Batch Scheduling <https://hal.archives-ouvertes.fr/hal-01333471>`_
218 `(more info) <https://simgrid.org/Usages.html>`_.
219
220 If your platform description is accurate enough (see
221 `here <http://hal.inria.fr/hal-00907887>`_ or
222 `there <https://hal.inria.fr/hal-01523608>`_),
223 SimGrid can provide high-quality performance predictions. For example,
224 we determined the speedup achieved by the Tibidabo ARM-based
225 cluster before its construction
226 (`paper <http://hal.inria.fr/hal-00919507>`_). In this case,
227 some differences between the prediction and the real timings were due to
228 misconfigurations with the real platform. To some extent,
229 SimGrid could even be used to debug the real platform :)
230
231 SimGrid is also used to debug, improve, and tune several large
232 applications.
233 `BigDFT <http://bigdft.org>`_ (a massively parallel code
234 computing the electronic structure of chemical elements developed by
235 the CEA), `StarPU <http://starpu.gforge.inria.fr/>`_ (a
236 Unified Runtime System for Heterogeneous Multicore Architectures
237 developed by Inria Bordeaux) and
238 `TomP2P <https://tomp2p.net/dev/simgrid/>`_ (a high performance
239 key-value pair storage library developed at the University of Zurich).
240 Some of these applications enjoy large user communities themselves.
241
242 ..  LocalWords:  SimGrid
243