-\subsubsection faq_platform_random Using random variable for the resource power or availability
-
-The best way to model the resouce power using a random variable is to
-use an availability trace that is directed by a probability
-distribution. This can be done using the function
-tmgr_trace_generator_value() below. The date and value generators is
-created with one of tmgr_event_generator_new_uniform(),
-tmgr_event_generator_new_exponential() or
-tmgr_event_generator_new_weibull() (if you need other generators,
-adding them to src/surf/trace_mgr.c should be quite trivial and your
-patch will be welcomed). Once your trace is created, you have to
-connect it to the resource with the function
-sg_platf_new_trace_connect().
-
-That the process is very similar if you want to model the
-resource availability with a random variable (deciding whether it's
-on/off instead of deciding its speed) using the function
-tmgr_trace_generator_state() or tmgr_trace_generator_avail_unavail()
-instead of tmgr_trace_generator_value().
-
-Unfortunately, all this is currently lacking a proper documentation,
-and there is even no proper example of use. You'll thus have to check
-the header file include/simgrid/platf.h and experiment a bit by
-yourself. The following code should be a good starting point, and
-contributing a little clean example would be a good way to help the
-SimGrid project.
-
-@code
-tmgr_trace_generator_value("mytrace",tmgr_event_generator_new_exponential(.5)
- tmgr_event_generator_new_uniform(100000,9999999));
-
-sg_platf_trace_connect_cbarg_t myconnect = SG_PLATF_TRACE_CONNECT_INITIALIZER;
-myconnect.kind = SURF_TRACE_CONNECT_KIND_BANDWIDTH;
-myconnect.trace = "mytrace";
-myconnect.element = "mylink";
-
-sg_platf_trace_connect(myconnect);
-@endcode
-
-\section faq_troubleshooting Troubleshooting
-
-\subsection faq_trouble_changelog The feature X stopped to work after my last update
-
-I guess that you want to read the ChangeLog file, that always contains
-all the information that could be important to the users during the
-upgrade. Actually, you may want to read it (alongside with the NEWS
-file that highlights the most important changes) even before you
-upgrade your copy of SimGrid, too.
-
-Backward compatibility is very important to us, as we want to provide
-a scientific tool allowing to evaluate the code you write in several
-years, too. That being said, we sometimes change the interface to make
-them more usable to the users. When we do so, we always keep the old
-interface as DEPRECATED. If you still want to use them, you want to
-define the SIMGRID_DEPRECATED preprocessor symbol before loading the
-SimGrid files:
-
-@verbatim
-#define SIMGRID_DEPRECATED
-#include <msg/msg.h>
-@endverbatim
-
-\subsection faq_trouble_lib_compil SimGrid compilation and installation problems
-
-\subsubsection faq_trouble_lib_config cmake fails!
-
-We know only one reason for the configure to fail:
-
- - <b>You are using a broken build environment</b>\n
- If symptom is that the configury magic complains about gcc not being able to build
- executables, you are probably missing the libc6-dev package. Damn Ubuntu.
-
-If you experience other kind of issue, please get in touch with us. We are
-always interested in improving our portability to new systems.
-
-\subsubsection faq_trouble_distcheck Dude! "ctest" fails on my machine!
-
-Don't assume we never run this target, because we do. Check
-http://cdash.inria.fr/CDash/index.php?project=Simgrid (click on
-previous if there is no result for today: results are produced only by
-11am, French time) and
-https://buildd.debian.org/status/logs.php?pkg=simgrid if you don't believe us.
-
-If it's failing on your machine in a way not experienced by the
-autobuilders above, please drop us a mail on the mailing list so that
-we can check it out. Make sure to read \ref faq_bugrepport before you
-do so.
-
-\subsection faq_trouble_compil User code compilation problems
-
-\subsubsection faq_trouble_err_logcat "gcc: _simgrid_this_log_category_does_not_exist__??? undeclared (first use in this function)"
-
-This is because you are using the log mecanism, but you didn't created
-any default category in this file. You should refer to \ref XBT_log
-for all the details, but you simply forgot to call one of
-XBT_LOG_NEW_DEFAULT_CATEGORY() or XBT_LOG_NEW_DEFAULT_SUBCATEGORY().
-
-\subsubsection faq_trouble_pthreadstatic "gcc: undefined reference to pthread_key_create"
-
-This indicates that one of the library SimGrid depends on (libpthread
-here) was missing on the linking command line. Dependencies of
-libsimgrid are expressed directly in the dynamic library, so it's
-quite impossible that you see this message when doing dynamic linking.
-
-If you compile your code statically (and if you use a pthread version
-of SimGrid -- see \ref faq_more_processes), you must absolutely
-specify <tt>-lpthread</tt> on the linker command line. As usual, this should
-come after <tt>-lsimgrid</tt> on this command line.
-
-\subsubsection faq_trouble_lib_msg_deprecated "gcc: undefined reference to MSG_*"
-
-Since version 3.7 all the m_channel_t mecanism is deprecated. So functions
-about this mecanism may get removed in future releases.
-
-List of functions:
-
-\li XBT_PUBLIC(int) MSG_get_host_number(void);
-
-\li XBT_PUBLIC(m_host_t *) MSG_get_host_table(void);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_get_errno(void);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_get(m_task_t * task, m_channel_t channel);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_get_with_timeout(m_task_t * task, m_channel_t channel, double max_duration);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_get_from_host(m_task_t * task, int channel, m_host_t host);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_get_ext(m_task_t * task, int channel, double max_duration, m_host_t host);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_put(m_task_t task, m_host_t dest, m_channel_t channel);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_put_bounded(m_task_t task, m_host_t dest, m_channel_t channel, double max_rate);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_task_put_with_timeout(m_task_t task, m_host_t dest, m_channel_t channel, double max_duration);
-
-\li XBT_PUBLIC(int) MSG_task_Iprobe(m_channel_t channel);
-
-\li XBT_PUBLIC(int) MSG_task_probe_from(m_channel_t channel);
-
-\li XBT_PUBLIC(int) MSG_task_probe_from_host(int channel, m_host_t host);
-
-\li XBT_PUBLIC(MSG_error_t) MSG_set_channel_number(int number);
-
-\li XBT_PUBLIC(int) MSG_get_channel_number(void);
-
-If you want them you have to compile Simgrid v3.7 with option "-Denable_msg_deprecated=ON".
-Using them should print warning to inform what new function you have to use.
-
-\subsection faq_trouble_errors Runtime error messages
-
-\subsubsection faq_flexml_limit "surf_parse_lex: Assertion `next limit' failed."
-
-This is because your platform file is too big for the parser.
-
-Actually, the message comes directly from FleXML, the technology on top of
-which the parser is built. FleXML has the bad idea of fetching the whole
-document in memory before parsing it. And moreover, the memory buffer size
-must be determined at compilation time.
-
-We use a value which seems big enough for our need without bloating the
-simulators footprints. But of course your mileage may vary. In this case,
-just edit src/surf/surfxml.l modify the definition of
-FLEXML_BUFFERSTACKSIZE. E.g.
-
-\verbatim
-#define FLEXML_BUFFERSTACKSIZE 1000000000
-\endverbatim
-
-Then recompile and everything should be fine, provided that your version of
-Flex is recent enough (>= 2.5.31). If not the compilation process should
-warn you.
-
-A while ago, we worked on FleXML to reduce a bit its memory consumption, but
-these issues remain. There is two things we should do:
-
- - use a dynamic buffer instead of a static one so that the only limit
- becomes your memory, not a stupid constant fixed at compilation time
- (maybe not so difficult).
- - change the parser so that it does not need to get the whole file in
- memory before parsing
- (seems quite difficult, but I'm a complete newbe wrt flex stuff).
-
-These are changes to FleXML itself, not SimGrid. But since we kinda hijacked
-the development of FleXML, I can grant you that any patches would be really
-welcome and quickly integrated.
-
-<b>Update:</b> A new version of FleXML (1.7) was released. Most of the work
-was done by William Dowling, who use it in his own work. The good point is
-that it now use a dynamic buffer, and that the memory usage was greatly
-improved. The downside is that William also changed some things internally,
-and it breaks the hack we devised to bypass the parser, as explained in
-\ref pf_flexml_bypassing. Indeed, this is not a classical usage of the
-parser, and Will didn't imagine that we may have used (and even documented)
-such a crude usage of FleXML. So, we now have to repair the bypassing
-functionality to use the latest FleXML version and fix the memory usage in
-SimGrid.
-
-\subsubsection faq_trouble_errors_big_fat_warning I'm told that my XML files are too old.
-
-The format of the XML platform description files is sometimes
-improved. For example, we decided to change the units used in SimGrid
-from MBytes, MFlops and seconds to Bytes, Flops and seconds to ease
-people exchanging small messages. We also reworked the route
-descriptions to allow more compact descriptions.
-
-That is why the XML files are versionned using the 'version' attribute
-of the root tag. Currently, it should read:
-\verbatim
- <platform version="2">
-\endverbatim
-
-If your files are too old, you can use the simgrid_update_xml.pl
-script which can be found in the tools directory of the archive.
-
-\subsection faq_trouble_debug Debugging SMPI applications
-
-In order to debug SMPI programs, you can use the following options:
-
-- <b>-wrapper 'gdb --args'</b>: this option is used to use a wrapper
- in order to call the SMPI process. Good candidates for this options
- are "gdb --args", "valgrind", "rr record", "strace", etc;
-
-- <b>-foreground</b>: this options gives the debugger access to the terminal
- which is needed in order to use an interactive debugger.
-
-Both options are needed in order to run the SMPI process under GDB.
-
-\subsection faq_trouble_valgrind Valgrind-related and other debugger issues
-
-If you don't, you really should use valgrind to debug your code, it's
-almost magic.
-
-\subsubsection faq_trouble_vg_longjmp longjmp madness in valgrind
-
-This is when valgrind starts complaining about longjmp things, just like:
-
-\verbatim ==21434== Conditional jump or move depends on uninitialised value(s)
-==21434== at 0x420DBE5: longjmp (longjmp.c:33)
-==21434==
-==21434== Use of uninitialised value of size 4
-==21434== at 0x420DC3A: __longjmp (__longjmp.S:48)
-\endverbatim
-
-This is the sign that you didn't used the exception mecanism well. Most
-probably, you have a <tt>return;</tt> somewhere within a <tt>TRY{}</tt>
-block. This is <b>evil</b>, and you must not do this. Did you read the section
-about \ref XBT_ex??
-
-\subsubsection faq_trouble_vg_libc Valgrind spits tons of errors about backtraces!
-
-It may happen that valgrind, the memory debugger beloved by any decent C
-programmer, spits tons of warnings like the following :
-\verbatim ==8414== Conditional jump or move depends on uninitialised value(s)
-==8414== at 0x400882D: (within /lib/ld-2.3.6.so)
-==8414== by 0x414EDE9: (within /lib/tls/i686/cmov/libc-2.3.6.so)
-==8414== by 0x400B105: (within /lib/ld-2.3.6.so)
-==8414== by 0x414F937: _dl_open (in /lib/tls/i686/cmov/libc-2.3.6.so)
-==8414== by 0x4150F4C: (within /lib/tls/i686/cmov/libc-2.3.6.so)
-==8414== by 0x400B105: (within /lib/ld-2.3.6.so)
-==8414== by 0x415102D: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.3.6.so)
-==8414== by 0x412D6B9: backtrace (in /lib/tls/i686/cmov/libc-2.3.6.so)
-==8414== by 0x8076446: xbt_dictelm_get_ext (dict_elm.c:714)
-==8414== by 0x80764C1: xbt_dictelm_get (dict_elm.c:732)
-==8414== by 0x8079010: xbt_cfg_register (config.c:208)
-==8414== by 0x806821B: MSG_config (msg_config.c:42)
-\endverbatim
-
-This problem is somewhere in the libc when using the backtraces and there is
-very few things we can do ourselves to fix it. Instead, here is how to tell
-valgrind to ignore the error. Add the following to your ~/.valgrind.supp (or
-create this file on need). Make sure to change the obj line according to
-your personnal mileage (change 2.3.6 to the actual version you are using,
-which you can retrieve with a simple "ls /lib/ld*.so").
-
-\verbatim {
- name: Backtrace madness
- Memcheck:Cond
- obj:/lib/ld-2.3.6.so
- fun:dl_open_worker
- fun:_dl_open
- fun:do_dlopen
- fun:dlerror_run
- fun:__libc_dlopen_mode
-}\endverbatim
-
-Then, you have to specify valgrind to use this suppression file by passing
-the <tt>--suppressions=$HOME/.valgrind.supp</tt> option on the command line.
-You can also add the following to your ~/.bashrc so that it gets passed
-automatically. Actually, it passes a bit more options to valgrind, and this
-happen to be my personnal settings. Check the valgrind documentation for
-more information.
-
-\verbatim export VALGRIND_OPTS="--leak-check=yes --leak-resolution=high --num-callers=40 --tool=memcheck --suppressions=$HOME/.valgrind.supp" \endverbatim
-
-\subsubsection faq_trouble_backtraces Truncated backtraces
-
-When debugging SimGrid, it's easier to pass the
---disable-compiler-optimization flag to the configure if valgrind or
-gdb get fooled by the optimization done by the compiler. But you
-should remove these flag when everything works before going in
-production (before launching your 1252135 experiments), or everything
-will run only one half of the true SimGrid potential.
-
-\subsection faq_deadlock There is a deadlock in my code!!!
-
-Unfortunately, we cannot debug every code written in SimGrid. We
-furthermore believe that the framework provides ways enough
-information to debug such informations yourself. If the textual output
-is not enough, Make sure to check the \ref faq_visualization FAQ entry to see
-how to get a graphical one.
-
-Now, if you come up with a really simple example that deadlocks and
-you're absolutely convinced that it should not, you can ask on the
-list. Just be aware that you'll be severely punished if the mistake is
-on your side... We have plenty of FAQ entries to redact and new
-features to implement for the impenitents! ;)
-
-Using
-
-\subsection faq_surf_network_latency I get weird timings when I play with the latencies.