Logo AND Algorithmique Numérique Distribuée

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