Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[doc] Under the hood
[simgrid.git] / doc / doxygen / getting_started.doc
1 /*! @page getting_started Getting Started: SimGrid Main Concepts
2
3 @tableofcontents
4
5 SimGrid is a framework to simulate distributed computer systems. 
6
7 It can be used to either assess abstract algorithms, or to profile and
8 debug real distributed applications.  SimGrid enables studies in the
9 domains of (data-)Grids, Clusters, IaaS Clouds, High Performance
10 Computing, Volunteer Computing and Peer-to-Peer.
11
12 Technically speaking, SimGrid is a library. It is not a graphical 
13 interface nor a command-line simulator running user scripts. You
14 interact with SimGrid by writting programs with the exposed functions
15 to build your own simulator.
16
17 SimGrid have many features, many options and many possibilities. The
18 documentation aims at smoothing the learning curve. But nothing's
19 perfect, and this documentation is really no exception here. Please
20 help us improving it by reporting the issues that you see and
21 proposing the content that is still missing.
22
23 SimGrid is a Free Software distributed under the LGPL licence. It
24 means that you are welcome to use it as you wish, or even to modify
25 and distribute your version (as long as your version is as free as
26 ours). It also means that SimGrid is developed by a vivid community of
27 users and developers. We hope that you will come and join us!
28
29 SimGrid is the result of over 15 years of research from several
30 groups, both in France and in the USA. It benefited of many fundings
31 from various research instances, including the ANR, Inria, CNRS,
32 University of Lorraine, University of Hawai'i at Manoa, ENS Rennes and
33 many others. Many thanks to our generous donators!
34
35 @section starting_components Typical Study based on SimGrid
36
37 Any SimGrid study entails the following components:
38
39  - The studied **Application**. This can be either a distributed
40    algorithm described in our simple APIs, or a full featured real
41    parallel application using the MPI interface (or other).
42
43  - The **Virtual Platform**. This is a description of a given
44    distributed system (machines, links, disks, clusters, etc). Most of
45    the platform files are written in XML althrough a Lua interface is
46    under development.  SimGrid makes it easy to augment the Virtual
47    Platform with a Dynamic Scenario where for example the links are
48    slowed down (because of external usage), the machines fail. You
49    have even support to specify the applicative workload that you want
50    to feed to your application.
51
52  - The application's **Deployment Description**. In SimGrid terminology,
53    the application is an inert set of source files and binaries. To
54    make it run, you have to describe how your application should be
55    deployed on the virtual platform. Specify which process is located
56    on which host, along with its parameters.
57
58  - The **Platform Models**. They describe how the virtual platform
59    reacts to the actions of the application. For example, they compute
60    the time taken by a given communication on the virtual platform.
61    These models are already included in SimGrid, and you only need to
62    pick one and maybe tweak its configuration to get your results.
63
64 These components are put together to run a **simulation**, that is an
65 experiment or a probe. The result of one or many simulation provides
66 an **outcome** (logs, visualization, statistical analysis) that help
67 answering the **question** targeted by this study.
68
69 The questions that SimGrid can solve include the following:
70
71  - **Compare an Application to another**. This is the classical use
72    case for scientists, who use SimGrid to test how the solution that
73    they contribute compares to the existing solutions from the
74    literature.
75
76  - **Design the best Virtual Platform for a given Application.**
77    Tweaking the platform file is much easier than building a new real
78    platform for testing purpose. SimGrid also allows co-design of the
79    platform and the application by modifying both of them.
80
81  - **Debug Real Applications**. With real systems, is sometimes
82    difficult to reproduce the exact run leading to the bug that you
83    are tracking. SimGrid gives you experimental reproducibility,
84    clairevoyance (you can explore every part of the system, and your
85    probe will not change the simulated state). It also makes it easy
86    to mock some parts of the real system that are not under study.
87
88 @section starting_gears SimGrid Execution Gears
89
90 Depending on the intended study, SimGrid can be run in several gears,
91 that are different execution modes.
92
93 ** **Simulation Gear**. This is the most common gear, where you want
94 to study how your application behaves on the virtual platform under
95 the experimental scenario.
96   
97 In this gear, SimGrid can provide information about the time taken by
98 your application, the amount of energy dissipated by the platform to
99 run your application and the detailed usage of each resource.
100    
101 ** **Model-Checking Gear**. This can be seen as a sort of exhaustive
102 testing gear, where every possible outcome of your application is
103 explored. In some sense, this gear tests your application for all
104 possible platforms that you could imagine (and more).
105   
106 You just provide the application and its deployment (amount of
107 processes and parameters), and the model-checker will litterally
108 explore all possible outcomes by testing all possible message
109 interleaving: if at some point a given process can either receive the
110 message A first or the message B depending on the platform
111 characteristics, the model-checker will explore the scenario where A
112 arrives first, and then rewind to the same point to explore the
113 scenarion where B arrives first.
114
115 This is a very powerful gear, where you can evaluate the correction of
116 your application. It can verify either *safety properties* (asserts) 
117 or *liveless properties* stating for example that if a given event
118 occures, then another given event will occur in a finite amount of
119 steps. This gear is not only usable with the abstract algorithms
120 developed on top of the SimGrid APIs, but also with real MPI
121 applications (to some extend).
122
123 The main limit of Model Checking lays in the huge amount of scenarios
124 to explore. SimGrid tries to explore only non-redundent scenarios
125 thanks to classical reduction techniques (such as DPOR and statefull
126 exploration) but the exploration may well never finish if you don't
127 carefully adapt your application to this gear.
128
129 Another limit of this gear is that it does not use the performance
130 models of the simulation gear. Time becomes discrete: You can say for
131 example that the application took 42 steps to run, but there is no way
132 to know the amount of seconds that it took or the amount of watts that
133 it dissipated.
134
135 Finally, the model checker only explores the interleavings of
136 computations and communications. Other factors such as thread
137 execution interleaving are not considered by the SimGrid model
138 checker.
139
140 The model checker may well miss existing issues, as it computes the
141 possible outcomes *from a given initial situation*. There is no way to
142 prove the correction of your application in all generality with this
143 tool.
144
145 ** **Benchmark Recording Gear**. During debug sessions, continuous
146 integration testing and other similar use cases, you are often only
147 interested in the control flow. If your application apply filters to
148 huge images split in small blocks, the filtered image is probably not
149 what you are interested in. You are probably looking for a way to run
150 each computation kernel only once, save on disk the time it takes and
151 some other metadata. This code block can then be skipped in simulation
152 and replaced by a synthetic block using the cached information. The
153 virtual platform will take this block into account without requesting
154 the real hosting machine to benchmark it.
155
156 @section starting_successes SimGrid Success Stories
157
158 TBD
159
160 - Many publications
161 - Accurate speedup prediction for the Mont-Blanc cluster
162 - It already happened that a divergence between the simulated outcome
163   and the reality resulted from a testbed misconfiguration. In some
164   sense, we fixed the reality because it was not getting the result
165   that SimGrid correctly computed :)
166 - Star-PU, BigDFT, TomP2P use SimGrid to chase their bugs and improve
167   their efficiency.
168
169 @section starting_limits SimGrid Limits
170
171 This framework is by no means the perfect holly grail able to solve
172 every problem on earth. 
173
174 ** **SimGrid scope is limited to distributed systems.** Real-time
175 multithreaded systems are not in the scope. You could probably tweak
176 SimGrid for such studies (or the framework could possibily be extended
177 in this direction), but another framework specifically targeting this
178 usecase would probably be more suited.
179
180 ** **There is currently no support for IoT studies and wireless networks**. 
181 The framework could certainly be improved in this direction, but this
182 is still to be done.
183
184 ** **There is no perfect model, only models adapted to your study.**
185 The SimGrid models target fast, large studies yet requesting a
186 realistic results. In particular, our models abstract away parameters
187 and phenomenon that are often irrelevant to the realism in our
188 context. 
189
190 SimGrid is simply not intended to any study that would mandate the
191 abstracted phenomenon. Here are some **studies that you should not do
192 with SimGrid**:
193
194  - Studying the effect of L3 vs L2 cache effects on your application
195  - Comparing variantes of TCP
196  - Exploring pathological cases where TCP breaks down, resulting in
197    abnormal executions.
198  - Studying security aspects of your application, in presence of
199    malicious agents.
200
201 @section starting_next Where to proceed next?
202
203 Now that you know about the basic concepts of SimGrid, you can give it
204 a try. If it's not done yet, first @ref install "install it". Then,
205 proceed to the section on @ref application "describing the application" that
206 you want to study.
207
208 */