Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #272 from mpoquet/SMPI_convert
[simgrid.git] / doc / doxygen / FAQ.doc
1 /*! \page FAQ MSG Frequently Asked Questions
2
3 @tableofcontents
4
5 This document is the FAQ of the MSG interface. Some entries are a bit aging and it should be refreshed at some point.
6
7 \section faq_simgrid I'm new to SimGrid. I have some questions. Where should I start?
8
9 You are at the right place... To understand what you can do or
10 cannot do with SimGrid, you should read the
11 <a href="http://simgrid.gforge.inria.fr/tutorials.php">tutorial
12 slides</a> from the SimGrid's website. You may find more uptodate
13 material on the
14 <a href="http://people.irisa.fr/Martin.Quinson/blog/SimGrid/">blog of
15 Martin Quinson</a>. 
16
17 Another great source of inspiration can be found in the \ref s4u_examples.
18
19 If you are stuck at any point and if this FAQ cannot help you, please drop us a
20 mail to the user mailing list: <simgrid-user@lists.gforge.inria.fr>.
21
22 \subsection faq_interfaces What is the difference between MSG and SimDag? Do they serve the same purpose?
23
24 It depend on how you define "purpose", I guess ;)
25
26 They all allow you to build a prototype of application which you can run
27 within the simulator afterward. They all share the same simulation kernel,
28 which is the core of the SimGrid project. They differ by the way you express
29 your application.
30
31 With SimDag, you express your code as a collection of interdependent
32 parallel tasks. So, in this model, applications can be seen as a DAG of
33 tasks. This is the interface of choice for people wanting to port old
34 code designed for SimGrid v1 or v2 to the framework current version.
35
36 With MSG, your application is seen as a set of communicating
37 processes, exchanging data by the way of messages and performing
38 computation on their own.
39
40 \subsection faq_visualization Visualizing and analyzing the results
41
42 It is sometime convenient to "see" how the agents are behaving. If you
43 like colors, you can use <tt>tools/MSG_visualization/colorize.pl </tt>
44 as a filter to your MSG outputs. It works directly with INFO. Beware,
45 INFO() prints on stderr. Do not forget to redirect if you want to
46 filter (e.g. with bash):
47 \verbatim
48 ./msg_test small_platform.xml small_deployment.xml 2>&1 | ../../tools/MSG_visualization/colorize.pl
49 \endverbatim
50
51 We also have a more graphical output. Have a look at section \ref options_tracing.
52
53 \subsection faq_C Argh! Do I really have to code in C?
54
55 We provide Java bindings of the MSG interface, which is the main
56 SimGrid user API.
57
58 Moreover If you use C++, you should be able to use the SimGrid library
59 as a standard C library and everything should work fine (simply
60 <i>link</i> against this library; recompiling SimGrid with a C++
61 compiler won't work and it wouldn't help if you could).
62
63 For now, we do not feel a real demand for any other language. But if
64 you think there is one, please speak up!
65
66 \section faq_howto Feature related questions
67
68 \subsection faq_MIA "Could you please add (your favorite feature here) to SimGrid?"
69
70 Here is the deal. The whole SimGrid project (MSG, SURF, ...) is
71 meant to be kept as simple and generic as possible. We cannot add
72 functions for everybody's needs when these functions can easily be
73 built from the ones already in the API. Most of the time, it is
74 possible and when it was not possible we always have upgraded the API
75 accordingly. When somebody asks us a question like "How to do that?
76 Is there a function in the API to simply do this?", we're always glad
77 to answer and help. However if we don't need this code for our own
78 need, there is no chance we're going to write it... it's your job! :)
79 The counterpart to our answers is that once you come up with a neat
80 implementation of this feature (task duplication, RPC, thread
81 synchronization, ...), you should send it to us and we will be glad to
82 add it to the distribution. Thus, other people will take advantage of
83 it (and we don't have to answer this question again and again ;).
84
85 You'll find in this section a few "Missing In Action" features. Many
86 people have asked about it and we have given hints on how to simply do
87 it with MSG. Feel free to contribute...
88
89 \subsection faq_MIA_MSG MSG features
90
91 \subsubsection faq_MIA_examples I want some more complex MSG examples!
92
93 Many people have come to ask me a more complex example and each time,
94 they have realized afterward that the basics were in the previous three
95 examples.
96
97 Of course they have often been needing more complex functions like
98 MSG_process_suspend(), MSG_process_resume() and
99 MSG_process_isSuspended() (to perform synchronization), or
100 MSG_task_Iprobe() and MSG_process_sleep() (to avoid blocking
101 receptions), or even MSG_process_create() (to design asynchronous
102 communications or computations). But the examples are sufficient to
103 start.
104
105 We know. We should add some more examples, but not really some more
106 complex ones... We should add some examples that illustrate some other
107 functionalists (like how to simply encode asynchronous
108 communications, RPC, process migrations, thread synchronization, ...)
109 and we will do it when we will have a little bit more time. We have
110 tried to document the examples so that they are understandable. Tell
111 us if something is not clear and once again feel free to participate!
112 :)
113
114 \subsubsection faq_MIA_taskdup Missing in action: MSG Task duplication/replication
115
116 There is no task duplication in MSG. When you create a task, you can
117 process it or send it somewhere else. As soon as a process has sent
118 this task, he doesn't have this task anymore. It's gone. The receiver
119 process has got the task. However, you could decide upon receiving to
120 create a "copy" of a task but you have to handle by yourself the
121 semantic associated to this "duplication".
122
123 As we already told, we prefer keeping the API as simple as
124 possible. This kind of feature is rather easy to implement by users
125 and the semantic you associate really depends on people. Having a
126 *generic* task duplication mechanism is not that trivial (in
127 particular because of the data field). That is why I would recommend
128 that you write it by yourself even if I can give you advice on how to
129 do it.
130
131 You have the following functions to get information about a task:
132 MSG_task_get_name(), MSG_task_get_compute_duration(),
133 MSG_task_get_remaining_computation(), MSG_task_get_data_size(),
134 and MSG_task_get_data().
135
136 You could use a dictionary (#xbt_dict_t) of dynars (#xbt_dynar_t). If
137 you still don't see how to do it, please come back to us...
138
139 \subsubsection faq_MIA_thread_synchronization How to synchronize my user processes?
140
141 It depends on why you want to synchronize them.  If you just want to
142 have a shared state between your processes, then you probably don't
143 need to do anything. User processes never get forcefully interrupted
144 in SimGrid (unless you explicitly request the parallel execution of
145 user processes -- see @ref options_virt_parallel).
146
147 Even if several processes are executed at the exact same time within
148 the simulation, they are linearized in reality by default: one process
149 always run in an exclusive manner, atomic, uninterrupted until it does
150 a simcall (until it ask a service from the simulation kernel). This is
151 surprising at first, but things are much easier this way, both for the
152 user (who don't have to protect her shared data) and for the kernel
153 (that avoid many synchronization issues too). Processes are executed
154 concurrently in the simulated realm, but you don't need to bother with
155 this in the real realm.
156
157 If you really need to synchronize your processes (because it's what
158 you are studying or to create an atomic section that spans over
159 several simcalls), you obviously cannot use regular synchronization
160 mechanisms (pthread_mutexes in C or the synchronized keyword in Java).
161 This is because the SimGrid kernel locks all processes and unlock them
162 one after the other when they are supposed to run, until they give the
163 control back in their simcall. If one of them gets locked by the OS 
164 before returning the control to the kernel, that's definitively a
165 deadlock.
166
167 Instead, you should use the synchronization mechanism provided by the
168 simulation kernel. This could with a SimGrid mutex, a SimGrid
169 condition variables or a SimGrid semaphore, as described in @ref
170 msg_synchro (in Java, only semaphores are available). But actually,
171 many synchronization patterns can be encoded with communication on
172 mailboxes. Typically, if you need one process to notify another one,
173 you could use a condition variable or a semphore, but sending a
174 message to a specific mailbox does the trick in most cases.
175
176 \subsubsection faq_MIA_host_load Where is the get_host_load function hidden in MSG?
177
178 There is no such thing because its semantic wouldn't be really
179 clear. Of course, it is something about the amount of host throughput,
180 but there is as many definition of "host load" as people asking for
181 this function. First, you have to remember that resource availability
182 may vary over time, which make any load notion harder to define.
183
184 It may be instantaneous value or an average one. Moreover it may be only the
185 power of the computer, or may take the background load into account, or may
186 even take the currently running tasks into account. In some SURF models,
187 communications have an influence on computational power. Should it be taken
188 into account too?
189
190 First of all, it's near to impossible to predict the load beforehand in the
191 simulator since it depends on too much parameters (background load
192 variation, bandwidth sharing algorithmic complexity) some of them even being
193 not known beforehand (other task starting at the same time). So, getting
194 this information is really hard (just like in real life). It's not just that
195 we want MSG to be as painful as real life. But as it is in some way
196 realistic, we face some of the same problems as we would face in real life.
197
198 How would you do it for real? The most common option is to use something
199 like NWS that performs active probes. The best solution is probably to do
200 the same within MSG, as in next code snippet. It is very close from what you
201 would have to do out of the simulator, and thus gives you information that
202 you could also get in real settings to not hinder the realism of your
203 simulation.
204
205 \code
206 double get_host_load() {
207    m_task_t task = MSG_task_create("test", 0.001, 0, NULL);
208    double date = MSG_get_clock();
209
210    MSG_task_execute(task);
211    date = MSG_get_clock() - date;
212    MSG_task_destroy(task);
213    return (0.001/date);
214 }
215 \endcode
216
217 Of course, it may not match your personal definition of "host load". In this
218 case, please detail what you mean on the mailing list, and we will extend
219 this FAQ section to fit your taste if possible.
220
221 \subsubsection faq_MIA_communication_time How can I get the *real* communication time?
222
223 Communications are synchronous and thus if you simply get the time
224 before and after a communication, you'll only get the transmission
225 time and the time spent to really communicate (it will also take into
226 account the time spent waiting for the other party to be
227 ready). However, getting the *real* communication time is not really
228 hard either. The following solution is a good starting point.
229
230 \code
231 int sender()
232 {
233   m_task_t task = MSG_task_create("Task", task_comp_size, task_comm_size,
234                                   calloc(1,sizeof(double)));
235   *((double*) task->data) = MSG_get_clock();
236   MSG_task_put(task, slaves[i % slaves_count], PORT_22);
237   XBT_INFO("Send completed");
238   return 0;
239 }
240 int receiver()
241 {
242   m_task_t task = NULL;
243   double time1,time2;
244
245   time1 = MSG_get_clock();
246   a = MSG_task_get(&(task), PORT_22);
247   time2 = MSG_get_clock();
248   if(time1<*((double *)task->data))
249      time1 = *((double *) task->data);
250   XBT_INFO("Communication time :  \"%f\" ", time2-time1);
251   free(task->data);
252   MSG_task_destroy(task);
253   return 0;
254 }
255 \endcode
256
257 \subsection faq_MIA_SimDag SimDag related questions
258
259 \subsubsection faq_SG_comm Implementing communication delays between tasks.
260
261 A classic question of SimDag newcomers is about how to express a
262 communication delay between tasks. The thing is that in SimDag, both
263 computation and communication are seen as tasks.  So, if you want to
264 model a data dependency between two DAG tasks t1 and t2, you have to
265 create 3 SD_tasks: t1, t2 and c and add dependencies in the following
266 way:
267
268 \code
269 SD_task_dependency_add(t1, c);
270 SD_task_dependency_add(c, t2);
271 \endcode
272
273 This way task t2 cannot start before the termination of communication c
274 which in turn cannot start before t1 ends.
275
276 When creating task c, you have to associate an amount of data (in bytes)
277 corresponding to what has to be sent by t1 to t2.
278
279 Finally to schedule the communication task c, you have to build a list
280 comprising the workstations on which t1 and t2 are scheduled (w1 and w2
281 for example) and build a communication matrix that should look like
282 [0;amount ; 0; 0].
283
284 \subsubsection faq_SG_DAG How to implement a distributed dynamic scheduler of DAGs.
285
286 Distributed is somehow "contagious". If you start making distributed
287 decisions, there is no way to handle DAGs directly anymore (unless I
288 am missing something). You have to encode your DAGs in term of
289 communicating process to make the whole scheduling process
290 distributed. Here is an example of how you could do that. Assume T1
291 has to be done before T2.
292
293 \code
294  int your_agent(int argc, char *argv[] {
295    ...
296    T1 = MSG_task_create(...);
297    T2 = MSG_task_create(...);
298    ...
299    while(1) {
300      ...
301      if(cond) MSG_task_execute(T1);
302      ...
303      if((MSG_task_get_remaining_computation(T1)=0.0) && (you_re_in_a_good_mood))
304         MSG_task_execute(T2)
305      else {
306         /* do something else */
307      }
308    }
309  }
310 \endcode
311
312 If you decide that the distributed part is not that much important and that
313 DAG is really the level of abstraction you want to work with, then you should
314 give a try to \ref SD_API.
315
316 \subsection faq_MIA_generic Generic features
317
318 \subsubsection faq_MIA_batch_scheduler Is there a native support for batch schedulers in SimGrid?
319
320 No, there is no native support for batch schedulers and none is
321 planned because this is a very specific need (and doing it in a
322 generic way is thus very hard). However some people have implemented
323 their own batch schedulers. Vincent Garonne wrote one during his PhD
324 and put his code in the contrib directory of our SVN so that other can
325 keep working on it. You may find inspiring ideas in it.
326
327 \subsubsection faq_MIA_checkpointing I need a checkpointing thing
328
329 Actually, it depends on whether you want to checkpoint the simulation, or to
330 simulate checkpoints.
331
332 The first one could help if your simulation is a long standing process you
333 want to keep running even on hardware issues. It could also help to
334 <i>rewind</i> the simulation by jumping sometimes on an old checkpoint to
335 cancel recent calculations.\n
336 Unfortunately, such thing will probably never exist in SG. One would have to
337 duplicate all data structures because doing a rewind at the simulator level
338 is very very hard (not talking about the malloc free operations that might
339 have been done in between). Instead, you may be interested in the Libckpt
340 library (http://www.cs.utk.edu/~plank/plank/www/libckpt.html). This is the
341 checkpointing solution used in the condor project, for example. It makes it
342 easy to create checkpoints (at the OS level, creating something like core
343 files), and rerunning them on need.
344
345 If you want to simulate checkpoints instead, it means that you want the
346 state of an executing task (in particular, the progress made towards
347 completion) to be saved somewhere.  So if a host (and the task executing on
348 it) fails (cf. #MSG_HOST_FAILURE), then the task can be restarted
349 from the last checkpoint.\n
350
351 Actually, such a thing does not exist in SimGrid either, but it's just
352 because we don't think it is fundamental and it may be done in the user code
353 at relatively low cost. You could for example use a watcher that
354 periodically get the remaining amount of things to do (using
355 MSG_task_get_remaining_computation()), or fragment the task in smaller
356 subtasks.
357
358 \subsection faq_platform Platform building and Dynamic resources
359
360 \subsubsection faq_platform_example Where can I find SimGrid platform files?
361
362 There are several little examples in the archive, in the examples/msg
363 directory. From time to time, we are asked for other files, but we
364 don't have much at hand right now.
365
366 You should refer to the Platform Description Archive
367 (http://pda.gforge.inria.fr) project to see the other platform file we
368 have available, as well as the Simulacrum simulator, meant to generate
369 SimGrid platforms using all classical generation algorithms.
370
371 \subsubsection faq_platform_alnem How can I automatically map an existing platform?
372
373 We are working on a project called ALNeM (Application-Level Network
374 Mapper) which goal is to automatically discover the topology of an
375 existing network. Its output will be a platform description file
376 following the SimGrid syntax, so everybody will get the ability to map
377 their own lab network (and contribute them to the catalog project).
378 This tool is not ready yet, but it move quite fast forward. Just stay
379 tuned.
380
381 \subsubsection faq_platform_synthetic Generating synthetic but realistic platforms
382
383 The third possibility to get a platform file (after manual or
384 automatic mapping of real platforms) is to generate synthetic
385 platforms. Getting a realistic result is not a trivial task, and
386 moreover, nobody is really able to define what "realistic" means when
387 speaking of topology files. You can find some more thoughts on this
388 topic in these
389 <a href="http://graal.ens-lyon.fr/~alegrand/articles/Simgrid-Introduction.pdf">slides</a>.
390
391 If you are looking for an actual tool, there we have a little tool to
392 annotate Tiers-generated topologies. This perl-script is in
393 <tt>tools/platform_generation/</tt> directory of the SVN. Dinda et Al.
394 released a very comparable tool, and called it GridG.
395
396
397 The specified computing power will be available to up to 6 sequential
398 tasks without sharing. If more tasks are placed on this host, the
399 resource will be shared accordingly. For example, if you schedule 12
400 tasks on the host, each will get half of the computing power. Please
401 note that although sound, this model were never scientifically
402 assessed. Please keep this fact in mind when using it.
403
404
405 \subsubsection faq_platform_random Using random variable for the resource power or availability
406
407 The best way to model the resouce power using a random variable is to
408 use an availability trace that is directed by a probability
409 distribution. This can be done using the function
410 tmgr_trace_generator_value() below. The date and value generators is
411 created with one of tmgr_event_generator_new_uniform(),
412 tmgr_event_generator_new_exponential() or
413 tmgr_event_generator_new_weibull() (if you need other generators,
414 adding them to src/surf/trace_mgr.c should be quite trivial and your
415 patch will be welcomed). Once your trace is created, you have to
416 connect it to the resource with the function
417 sg_platf_new_trace_connect().
418
419 That the process is very similar if you want to model the
420 resource availability with a random variable (deciding whether it's
421 on/off instead of deciding its speed) using the function
422 tmgr_trace_generator_state() or tmgr_trace_generator_avail_unavail()
423 instead of tmgr_trace_generator_value().
424
425 Unfortunately, all this is currently lacking a proper documentation,
426 and there is even no proper example of use. You'll thus have to check
427 the header file include/simgrid/platf.h and experiment a bit by
428 yourself. The following code should be a good starting point, and
429 contributing a little clean example would be a good way to help the
430 SimGrid project.
431
432 @code
433 tmgr_trace_generator_value("mytrace",tmgr_event_generator_new_exponential(.5)
434                                      tmgr_event_generator_new_uniform(100000,9999999));
435                                      
436 sg_platf_trace_connect_cbarg_t myconnect = SG_PLATF_TRACE_CONNECT_INITIALIZER;
437 myconnect.kind = SURF_TRACE_CONNECT_KIND_BANDWIDTH;
438 myconnect.trace = "mytrace";
439 myconnect.element = "mylink";
440
441 sg_platf_trace_connect(myconnect);
442 @endcode
443
444 \section faq_troubleshooting Troubleshooting
445
446 \subsection faq_trouble_changelog The feature X stopped to work after my last update 
447
448 I guess that you want to read the ChangeLog file, that always contains
449 all the information that could be important to the users during the
450 upgrade. Actually, you may want to read it (alongside with the NEWS
451 file that highlights the most important changes) even before you
452 upgrade your copy of SimGrid, too.
453
454 We do our best to maintain the backward compatibility, but we
455 sometimes have to fix the things that are too broken. If we happen to
456 kill a feature that you were using, we are sorry. We think that you
457 should update to the new way of doing things, but if you can't afford
458 it, that's ok. Just stick to the last version that were working for
459 you, and have a pleasant day.
460
461 \subsection faq_trouble_lib_compil SimGrid compilation and installation problems
462
463 \subsubsection faq_trouble_lib_config cmake fails!
464
465 We know only one reason for the configure to fail:
466
467  - <b>You are using a broken build environment</b>\n
468    Try updating your cmake version. If symptom is that the configury
469    magic complains about gcc not being able to build executables, you
470    are probably missing the libc6-dev package. Damn Ubuntu. 
471
472 If you experience other kind of issue, please get in touch with us. We are
473 always interested in improving our portability to new systems.
474
475 \subsubsection faq_trouble_distcheck Dude! "ctest" fails on my machine!
476
477 Don't assume we never run this target, because we do. Check
478 http://cdash.inria.fr/CDash/index.php?project=Simgrid (click on
479 previous if there is no result for today: results are produced only by
480 11am, French time) and
481 https://buildd.debian.org/status/logs.php?pkg=simgrid if you don't believe us.
482
483 If it's failing on your machine in a way not experienced by the
484 autobuilders above, please drop us a mail on the mailing list so that
485 we can check it out. Make sure to read \ref faq_bugrepport before you
486 do so.
487
488 \subsection faq_trouble_compil User code compilation problems
489
490 \subsubsection faq_trouble_err_logcat "gcc: _simgrid_this_log_category_does_not_exist__??? undeclared (first use in this function)"
491
492 This is because you are using the log mechanism, but you didn't created
493 any default category in this file. You should refer to \ref XBT_log
494 for all the details, but you simply forgot to call one of
495 XBT_LOG_NEW_DEFAULT_CATEGORY() or XBT_LOG_NEW_DEFAULT_SUBCATEGORY().
496
497 \subsubsection faq_trouble_pthreadstatic "gcc: undefined reference to pthread_key_create"
498
499 This indicates that one of the library SimGrid depends on (libpthread
500 here) was missing on the linking command line. Dependencies of
501 libsimgrid are expressed directly in the dynamic library, so it's
502 quite impossible that you see this message when doing dynamic linking.
503
504 If you compile your code statically (and if you use a pthread version
505 of SimGrid), you must absolutely
506 specify <tt>-lpthread</tt> on the linker command line. As usual, this should
507 come after <tt>-lsimgrid</tt> on this command line.
508
509 \subsection faq_trouble_errors Runtime error messages
510
511 \subsubsection faq_trouble_errors_big_fat_warning I'm told that my XML files are too old.
512
513 The format of the XML platform description files is sometimes
514 improved. For example, we decided to change the units used in SimGrid
515 from MBytes, MFlops and seconds to Bytes, Flops and seconds to ease
516 people exchanging small messages. We also reworked the route
517 descriptions to allow more compact descriptions.
518
519 That is why the XML files are versionned using the 'version' attribute
520 of the root tag. Currently, it should read:
521 @verbatim
522   <platform version="4">
523 @endverbatim
524
525 If your files are too old, you can use the simgrid_update_xml.pl
526 script which can be found in the tools directory of the archive.
527
528 \subsection faq_trouble_debug Debugging SMPI applications
529
530 In order to debug SMPI programs, you can use the following options:
531
532 - <b>-wrapper 'gdb --args'</b>: this option is used to use a wrapper
533   in order to call the SMPI process. Good candidates for this options
534   are "gdb --args", "valgrind", "rr record", "strace", etc;
535
536 - <b>-foreground</b>: this options gives the debugger access to the terminal
537   which is needed in order to use an interactive debugger.
538
539 Both options are needed in order to run the SMPI process under GDB.
540
541 \subsection faq_trouble_valgrind Valgrind-related and other debugger issues
542
543 If you don't, you really should use valgrind to debug your code, it's
544 almost magic.
545
546 \subsubsection faq_trouble_vg_libc Valgrind spits tons of errors about backtraces!
547
548 It may happen that valgrind, the memory debugger beloved by any decent C
549 programmer, spits tons of warnings like the following :
550 \verbatim ==8414== Conditional jump or move depends on uninitialised value(s)
551 ==8414==    at 0x400882D: (within /lib/ld-2.3.6.so)
552 ==8414==    by 0x414EDE9: (within /lib/tls/i686/cmov/libc-2.3.6.so)
553 ==8414==    by 0x400B105: (within /lib/ld-2.3.6.so)
554 ==8414==    by 0x414F937: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
555 ==8414==    by 0x4150F4C: (within /lib/tls/i686/cmov/libc-2.3.6.so)
556 ==8414==    by 0x400B105: (within /lib/ld-2.3.6.so)
557 ==8414==    by 0x415102D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
558 ==8414==    by 0x412D6B9: backtrace (in /lib/tls/i686/cmov/libc-2.3.6.so)
559 ==8414==    by 0x8076446: xbt_dictelm_get_ext (dict_elm.c:714)
560 ==8414==    by 0x80764C1: xbt_dictelm_get (dict_elm.c:732)
561 ==8414==    by 0x8079010: xbt_cfg_register (config.c:208)
562 ==8414==    by 0x806821B: MSG_config (msg_config.c:42)
563 \endverbatim
564
565 This problem is somewhere in the libc when using the backtraces and there is
566 very few things we can do ourselves to fix it. Instead, here is how to tell
567 valgrind to ignore the error. Add the following to your ~/.valgrind.supp (or
568 create this file on need). Make sure to change the obj line according to
569 your personnal mileage (change 2.3.6 to the actual version you are using,
570 which you can retrieve with a simple "ls /lib/ld*.so").
571
572 \verbatim {
573    name: Backtrace madness
574    Memcheck:Cond
575    obj:/lib/ld-2.3.6.so
576    fun:dl_open_worker
577    fun:_dl_open
578    fun:do_dlopen
579    fun:dlerror_run
580    fun:__libc_dlopen_mode
581 }\endverbatim
582
583 Then, you have to specify valgrind to use this suppression file by passing
584 the <tt>--suppressions=$HOME/.valgrind.supp</tt> option on the command line.
585 You can also add the following to your ~/.bashrc so that it gets passed
586 automatically. Actually, it passes a bit more options to valgrind, and this
587 happen to be my personnal settings. Check the valgrind documentation for
588 more information.
589
590 \verbatim export VALGRIND_OPTS="--leak-check=yes --leak-resolution=high --num-callers=40 --tool=memcheck --suppressions=$HOME/.valgrind.supp" \endverbatim
591
592 \subsubsection faq_trouble_backtraces Truncated backtraces
593
594 When debugging SimGrid, it's easier to pass the
595 --disable-compiler-optimization flag to the configure if valgrind or
596 gdb get fooled by the optimization done by the compiler. But you
597 should remove these flag when everything works before going in
598 production (before launching your 1252135 experiments), or everything
599 will run only one half of the true SimGrid potential.
600
601 \subsection faq_deadlock There is a deadlock in my code!!!
602
603 Unfortunately, we cannot debug every code written in SimGrid.  We
604 furthermore believe that the framework provides ways enough
605 information to debug such information yourself. If the textual output
606 is not enough, Make sure to check the \ref faq_visualization FAQ entry to see
607 how to get a graphical one.
608
609 Now, if you come up with a really simple example that deadlocks and
610 you're absolutely convinced that it should not, you can ask on the
611 list. Just be aware that you'll be severely punished if the mistake is
612 on your side... We have plenty of FAQ entries to redact and new
613 features to implement for the impenitents! ;)
614
615 \subsection faq_surf_network_latency I get weird timings when I play with the latencies.
616
617 OK, first of all, remember that units should be Bytes, Flops and
618 Seconds. If you don't use such units, some SimGrid constants (e.g. the
619 SG_TCP_CTE_GAMMA constant used in most network models) won't have the
620 right unit and you'll end up with weird results.
621
622 Here is what happens with a single transfer of size L on a link
623 (bw,lat) when nothing else happens.
624
625 \verbatim
626 0-----lat--------------------------------------------------t
627 |-----|**** real_bw =min(bw,SG_TCP_CTE_GAMMA/(2*lat)) *****|
628 \endverbatim
629
630 In more complex situations, this min is the solution of a complex
631 max-min linear system.  Have a look
632 <a href="http://lists.gforge.inria.fr/pipermail/simgrid-devel/2006-April/thread.html">here</a>
633 and read the two threads "Bug in SURF?" and "Surf bug not
634 fixed?". You'll have a few other examples of such computations. You
635 can also read "A Network Model for Simulation of Grid Application" by
636 Henri Casanova and Loris Marchal to have all the details. The fact
637 that the real_bw is smaller than bw is easy to understand. The fact
638 that real_bw is smaller than SG_TCP_CTE_GAMMA/(2*lat) is due to the
639 window-based congestion mechanism of TCP. With TCP, you can't exploit
640 your huge network capacity if you don't have a good round-trip-time
641 because of the acks...
642
643 Anyway, what you get is t=lat + L/min(bw,SG_TCP_CTE_GAMMA/(2*lat)).
644
645   * if I you set (bw,lat)=(100 000 000, 0.00001), you get t =  1.00001 (you fully
646 use your link)
647   * if I you set (bw,lat)=(100 000 000, 0.0001),  you get t =  1.0001 (you're on the
648 limit)
649   * if I you set (bw,lat)=(100 000 000, 0.001),   you get t = 10.001  (ouch!)
650
651 This bound on the effective bandwidth of a flow is not the only thing
652 that may make your result be unexpected. For example, two flows
653 competing on a saturated link receive an amount of bandwidth inversely
654 proportional to their round trip time.
655
656 \subsection faq_bugrepport So I've found a bug in SimGrid. How to report it?
657
658 We do our best to make sure to hammer away any bugs of SimGrid, but this is
659 still an academic project so please be patient if/when you find bugs in it.
660 If you do, the best solution is to drop an email either on the simgrid-user
661 or the simgrid-devel mailing list and explain us about the issue.  You can
662 also decide to open a formal bug report using the
663 <a href="https://gforge.inria.fr/tracker/?atid=165&group_id=12&func=browse">relevant
664 interface</a>. You need to login on the server to get the ability to submit
665 bugs.
666
667 We will do our best to solve any problem repported, but you need to help us
668 finding the issue. Just telling "it segfault" isn't enough. Telling "It
669 segfaults when running the attached simulator" doesn't really help either.
670 You may find the following article interesting to see how to repport
671 informative bug repports:
672 http://www.chiark.greenend.org.uk/~sgtatham/bugs.html (it is not SimGrid
673 specific at all, but it's full of good advices).
674
675 \author Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
676
677 */