Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f465374001217f10435cadf25b3fbed1067b98ae
[simgrid.git] / docs / source / community.rst
1 .. _community:
2
3 The SimGrid Community
4 =====================
5
6 SimGrid is a free software, written by a community of people. It
7 started as a little software to help ourselves in our own research,
8 and as more people put their input into the pot, it turned into
9 something that we hope to be valuable to many people. So yes. We hope
10 that SimGrid is helping you doing what you want, and that you will
11 join our community of happy simgriders.
12
13 Contacting the community
14 ------------------------
15
16 There are several locations where you can connect and discuss about
17 SimGrid. If you have a question, please have a look at the
18 documentation and examples first, but if some remain don't hesitate to
19 ask the community for help. If you do not have a question, just come
20 to us and say hello! We love earing about how people use SimGrid.
21
22  - For questions or remarks, drop us an email on the `user mailing
23    list <mailto:simgrid-community@inria.fr>`_ (to subscribe,
24    visit the `web interface
25    <https://sympa.inria.fr/sympa/info/simgrid-community>`__).
26    We prefer you to **not use private emails**. SimGrid is an open
27    framework, and you never know who have the time and knowledge to
28    answer your question, so please keep messages on the public mailing
29    list.
30
31  - If you want to chat with the community, join us on `Mattermost
32    <https://framateam.org/simgrid/channels/town-square>`_. Be warned
33    that even if many people are connected to the channel, they may not
34    be staring at their chat windows. So don't be surprised if you
35    don't get an answer in the second, and please be patient.
36
37    If you prefer, you can reach us on IRC on \#simgrid at
38    ``irc.debian.org`` (the `logs are available
39    <http://colabti.org/irclogger/irclogger_logs/simgrid>`_). When no
40    non-french speaker are connected, we usually chat in french on
41    these channel, but we do switch back to english when we have a
42    guest.
43
44  - Asking your question on
45    `StackOverflow <http://stackoverflow.com/questions/tagged/simgrid>`_
46    is also a good idea, as this
47    site is very well indexed. We answer questions there too (don't
48    forget to use the SimGrid tag in your question so that we can see
49    it), and they remain usable for the next users.
50
51 Giving back to SimGrid
52 ----------------------
53
54 We are sometimes asked by users how to give back to the project. Here
55 are some ideas, but if you have new ones, feel free to share them with us.
56
57 Provide fresh-eyes feedback
58 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
59
60 We are working on the project since years. We take for granted things that are hard to infer at first, and traps we don't even see anymore.
61 Likewise, it's hard for us to maintain the documentation uptodate with the current situation, because we don't rely on the doc when navigating the project.
62 This is why your first impression as a newcomer to the project is utterly precious for us.
63 Please make sure to write a `discovery report <https://diff.wikimedia.org/2014/03/25/seeing-through-the-eyes-of-new-technical-contributors/>`_ to enlight us.
64 You can send it either as a bug report, as a mail on the list or simply post it as is to the Mattermost channel.
65
66 Spread the word
67 ^^^^^^^^^^^^^^^
68
69 A simple way to help the SimGrid project is to **use SimGrid for your research, and say so**.
70 `Cite the SimGrid framework<https://simgrid.org/publications.html>`_ in your papers and speak of it with your colleagues to spread the word.
71 The number of publications enabled by SimGrid is really important when asking for further fundings to sustain the project:
72 The more you use the framework, the better for us.
73
74 Add a link to the `SimGrid homepage <https://simgrid.org>`_ on your site to improve our ranking in search engines.
75
76 You can also **help us constituting an active and welcoming user community**. Answer to the question sent to the mailing lists if you can, gently pointing to
77 the relevant part of the documentation on need, and help newscomers becoming part of our community too.
78
79 Finally, you can invite us for a talk on SimGrid to events you organize.
80 We have various format, ranging from a focused `20 minute talks <http://people.irisa.fr/Martin.Quinson/blog/2020/1124/SimGrid_presentations>`_
81 to a `45mn dense tutorial <http://people.irisa.fr/Martin.Quinson/blog/2012/1120/Simgrid_at_Louvain/>`_,
82 to a `2 hours seminar <http://people.irisa.fr/Martin.Quinson/blog/2016/0524/Experimental_methodology_for_distributed_systems>`_, or
83 even to `multi-days events <https://simgrid.org/tutorials.html>`_.
84 Note that even if most of these examples are from the same individual, several people in the team can present the project.
85 It's just that I wrote this paragraph so took the examples I knew, from my own experience :)
86
87 Report (and fix) issues
88 ^^^^^^^^^^^^^^^^^^^^^^^
89
90 Because of its size and complexity, SimGrid far from perfect and
91 contains a large amount of glitches and issues. When you find one,
92 don't assume that it's here because we don't care. It survived only
93 because nobody told us. We unfortunately cannot endlessly review our
94 large code and documentation base. So please, **report any issue you
95 find**, be it a typo in the documentation, a paragraph that needs to
96 be reworded, a bug in the code, or any other problem. The best way to
97 do so is to open an issue on our
98 `Bug Tracker <https://framagit.org/simgrid/simgrid/issues>`_ so
99 that we don't forget about it.
100
101 The worst way to report such issues is to go through private emails.
102 These are unreliable, and we are trying to develop SimGrid openly, so
103 private discussions are to be avoided if possible.
104
105 If you can provide a patch fixing the issue you report, that's even
106 better. If you cannot, then you need to give us a minimal working
107 example (MWE), that is a ready to use solution that reproduces the
108 problem you face. Your bug will take much more time
109 for us to reproduce and fix if you don't give us the MWE, so you want
110 to help us helping you to get things efficient.
111
112 Of course, a very good way to give back to the SimGrid community is to
113 triage and fix the bugs in the Bug Tracking Systems. If the bug report
114 has no MWE, we'd love you to contribute one. If you can come up with a
115 patch, we will be more than happy to apply your changes so that the
116 whole community enjoys them.
117
118 Extending SimGrid and its Ecosystem
119 -----------------------------------
120
121 Contributing Code
122 ^^^^^^^^^^^^^^^^^
123
124 If you deeply miss a feature in the framework, you should consider
125 implementing it yourself. SimGrid is free software, meaning that you are
126 free to help yourself. Of course, we'll do our best to assist you in
127 this task, so don't hesitate to contact us with your idea.
128
129 You could write a new plugin extending SimGrid in some way, or a
130 routing model for another kind of network. But even if you write your own
131 platform file, this is probably interesting to other users too, and
132 could be included to SimGrid. Modeling accurately a given platform is
133 a difficult work, which outcome is very precious to us.
134
135 Or maybe you developed an independent tool on top of SimGrid. We'd
136 love helping you gaining visibility by listing it in our
137 `Contrib <https://simgrid.org/contrib.html>`_.
138
139 Possible Enhancements
140 ^^^^^^^^^^^^^^^^^^^^^
141
142 If you want to start working on the SimGrid codebase, here are a few
143 ideas of things that could be done to improve the current code (not all of them
144 are difficult, do trust yourself ;)
145
146 Time and duration
147 """""""""""""""""
148
149 We should avoir using "-1" to mean "forever" at least in S4U and in
150 the internal code.  We should probably always use separate functions
151 (`wait` vs `wait_for`).
152
153 Futures and Promises
154 """"""""""""""""""""
155
156  - Some features are missing in the Maestro future implementation
157    (`simgrid::kernel::Future`, `simgrid::kernel::Promise`)
158    could be extended to support additional features:
159    `when_any`, `shared_future`, etc.
160
161  - The corresponding feature might then be implemented in the user process
162    futures (`simgrid::simix::Future`).
163
164  - Currently `.then()` is not available for user futures. We would need to add
165    a basic user event loop in order to queue the pending continuations.
166
167  - We might need to provide an option to cancel a pending operation. This
168    might be achieved by defining some `Action` or `Operation` class with an
169    API compatible with `Future` (and convertible to it) but with an
170    additional `.cancel()` method.
171
172 MC: Overhaul the state comparison code
173 """"""""""""""""""""""""""""""""""""""
174
175 The state comparison code is quite complicated. It has very long functions and
176 is programmed mostly using C idioms and is difficult to understand and debug.
177 It is in need of an overhaul:
178
179   - cleanup, refactoring, usage of C++ features.
180
181   - The state comparison code works by inferring types of blocks allocated on the
182     heap by following pointers from known roots (global variables, local
183     variables). Usually the first type found for a given block is used even if
184     a better one could be found later. By using a first pass of type inference,
185     on each snapshot before comparing the states, we might use a better type
186     information on the different blocks.
187
188   - We might benefit from adding logic for handling some known types. For
189     example, both `std::string` and `std::vector` have a capacity which might
190     be larger than the current size of the container. We should ignore
191     the corresponding elements when comparing the states and inferring the types.
192
193   - Another difficulty in the state comparison code is the detection of
194     dangling pointers. We cannot easily know if a pointer is dangling and
195     dangling pointers might lead us to choose the wrong type when inferring
196     heap blocks. We might mitigate this problem by delaying the reallocation of
197     a freed block until there is no blocks pointing to it anymore using some
198     sort of basic garbage-collector.
199
200 MC: Hashing the states
201 """"""""""""""""""""""
202
203 In order to speed up the state comparison an idea was to create a hash of the
204 state. Only states with the same hash would need to be compared using the
205 state comparison algorithm. Some information should not be included in the
206 hash in order to avoid considering different states which would otherwise
207 would have been considered equal.
208
209 The states could be indexed by their hash. Currently they are indexed
210 by the number of processes and the amount of heap currently allocated
211 (see `DerefAndCompareByNbProcessesAndUsedHeap`).
212
213 Good candidate information for the state hashing:
214
215  - number of processes;
216
217  - their backtraces (instruction addresses);
218
219  - their current simcall numbers;
220
221  - some simcall arguments (eg. number of elements in a waitany);
222
223  - number of pending communications;
224
225  - etc.
226
227 Some basic infrastructure for this is already in the code (see `mc_hash.cpp`)
228 but it is currently disabled.
229
230 Interface with the model-checked processes
231 """"""""""""""""""""""""""""""""""""""""""
232
233 The model checker reads many information about the model-checked process by
234 `process_vm_readv()`-ing brutally the data structure of the model-checked
235 process leading to some inefficient code such as maintaining copies of complex
236 C++ structures in XBT dynars. We need a sane way to expose the relevant
237 information to the model checker.
238
239 Generic simcalls
240 """"""""""""""""
241
242 We have introduced some generic simcalls which can be used to execute a
243 callback in a SimGrid Maestro context. It makes it a lot easier to interface
244 the simulated process with the maestro. However, the callbacks for the
245 model checker which cannot decide how it should handle them. We would need a
246 solution for this if we want to be able to replace the simcalls the
247 model checker cares about by generic simcalls.
248
249 Defining an API for writing Model-Checking algorithms
250 """""""""""""""""""""""""""""""""""""""""""""""""""""
251
252 Currently, writing a new model-checking algorithms in SimGridMC is quite
253 difficult: the logic of the model-checking algorithm is mixed with a lot of
254 low-level concerns about the way the model checker is implemented. This makes it
255 difficult to write new algorithms and difficult to understand, debug, and modify
256 the existing ones. We need a clean API to express the model-checking algorithms
257 in a form which is closer to the text-book/paper description. This API must
258 be exposed in a language which is more adequate to this task.
259
260 Tasks:
261
262   1. Design and implement a clean API to express model-checking algorithms.
263      A `Session` class currently exists for this but is not feature complete
264      and should probably be rewritten. It should be easy to create bindings
265      for different languages on top of this API.
266
267   2. Create a binding to some better suited, dynamic, scripting language
268      (e.g., Lua).
269
270   3. Rewrite the existing model-checking algorithms in this language using the
271      new API.