Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[Documentation] Added descriptions for 3 more configuration directives.
[simgrid.git] / doc / doxygen / options.doc
1 /*! \page options Simgrid options and configurations
2
3 A number of options can be given at runtime to change the default
4 SimGrid behavior. For a complete list of all configuration options
5 accepted by the SimGrid version used in your simulator, simply pass
6 the --help configuration flag to your program. If some of the options
7 are not documented on this page, this is a bug that you should please
8 report so that we can fix it. Note that some of the options presented
9 here may not be available in your simulators, depending on the
10 @ref install_src_config "compile-time options" that you used.
11
12 \section options_using Passing configuration options to the simulators
13
14 There is several way to pass configuration options to the simulators.
15 The most common way is to use the \c --cfg command line argument. For
16 example, to set the item \c Item to the value \c Value, simply
17 type the following: \verbatim
18 my_simulator --cfg=Item:Value (other arguments)
19 \endverbatim
20
21 Several \c `--cfg` command line arguments can naturally be used. If you
22 need to include spaces in the argument, don't forget to quote the
23 argument. You can even escape the included quotes (write \' for ' if
24 you have your argument between ').
25
26 Another solution is to use the \c \<config\> tag in the platform file. The
27 only restriction is that this tag must occure before the first
28 platform element (be it \c \<AS\>, \c \<cluster\>, \c \<peer\> or whatever).
29 The \c \<config\> tag takes an \c id attribute, but it is currently
30 ignored so you don't really need to pass it. The important par is that
31 within that tag, you can pass one or several \c \<prop\> tags to specify
32 the configuration to use. For example, setting \c Item to \c Value
33 can be done by adding the following to the beginning of your platform
34 file:
35 \verbatim
36 <config>
37   <prop id="Item" value="Value"/>
38 </config>
39 \endverbatim
40
41 A last solution is to pass your configuration directly using the C
42 interface. If you happen to use the MSG interface, this is very easy
43 with the MSG_config() function. If you do not use MSG, that's a bit
44 more complex, as you have to mess with the internal configuration set
45 directly as follows. Check the \ref XBT_config "relevant page" for
46 details on all the functions you can use in this context, \c
47 _sg_cfg_set being the only configuration set currently used in
48 SimGrid.
49
50 @code
51 #include <xbt/config.h>
52
53 extern xbt_cfg_t _sg_cfg_set;
54
55 int main(int argc, char *argv[]) {
56      SD_init(&argc, argv);
57
58      /* Prefer MSG_config() if you use MSG!! */
59      xbt_cfg_set_parse(_sg_cfg_set,"Item:Value");
60
61      // Rest of your code
62 }
63 @endcode
64
65 \section options_model Configuring the platform models
66
67 \subsection options_model_select Selecting the platform models
68
69 SimGrid comes with several network and CPU models built in, and you
70 can change the used model at runtime by changing the passed
71 configuration. The three main configuration items are given below.
72 For each of these items, passing the special \c help value gives
73 you a short description of all possible values. Also, \c --help-models
74 should provide information about all models for all existing resources.
75    - \b network/model: specify the used network model
76    - \b cpu/model: specify the used CPU model
77    - \b workstation/model: specify the used workstation model
78
79 %As of writing, the following network models are accepted. Over
80 the time new models can be added, and some experimental models can be
81 removed; check the values on your simulators for an uptodate
82 information. Note that the CM02 model is described in the research report
83 <a href="ftp://ftp.ens-lyon.fr/pub/LIP/Rapports/RR/RR2002/RR2002-40.ps.gz">A
84 Network Model for Simulation of Grid Application</a> while LV08 is
85 described in
86 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>.
87
88   - \b LV08 (default one): Realistic network analytic model
89     (slow-start modeled by multiplying latency by 10.4, bandwidth by
90     .92; bottleneck sharing uses a payload of S=8775 for evaluating RTT)
91   - \b Constant: Simplistic network model where all communication
92     take a constant time (one second). This model provides the lowest
93     realism, but is (marginally) faster.
94   - \b SMPI: Realistic network model specifically tailored for HPC
95     settings (accurate modeling of slow start with correction factors on
96     three intervals: < 1KiB, < 64 KiB, >= 64 KiB). See also \ref
97     options_model_network_coefs "this section" for more info.
98   - \b IB: Realistic network model specifically tailored for HPC
99     settings with InfiniBand networks (accurate modeling contention
100     behavior, based on the model explained in
101     http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf).
102     See also \ref options_model_network_coefs "this section" for more info.
103   - \b CM02: Legacy network analytic model (Very similar to LV08, but
104     without corrective factors. The timings of small messages are thus
105     poorly modeled)
106   - \b Reno: Model from Steven H. Low using lagrange_solve instead of
107     lmm_solve (experts only; check the code for more info).
108   - \b Reno2: Model from Steven H. Low using lagrange_solve instead of
109     lmm_solve (experts only; check the code for more info).
110   - \b Vegas: Model from Steven H. Low using lagrange_solve instead of
111     lmm_solve (experts only; check the code for more info).
112
113 If you compiled SimGrid accordingly, you can use packet-level network
114 simulators as network models (see \ref pls). In that case, you have
115 two extra models, described below, and some \ref options_pls "specific
116 additional configuration flags".
117   - \b GTNets: Network pseudo-model using the GTNets simulator instead
118     of an analytic model
119   - \b NS3: Network pseudo-model using the NS3 tcp model instead of an
120     analytic model
121
122 Concerning the CPU, we have only one model for now:
123   - \b Cas01: Simplistic CPU model (time=size/power)
124
125 The workstation concept is the aggregation of a CPU with a network
126 card. Three models exists, but actually, only 2 of them are
127 interesting. The "compound" one is simply due to the way our internal
128 code is organized, and can easily be ignored. So at the end, you have
129 two workstation models: The default one allows to aggregate an
130 existing CPU model with an existing network model, but does not allow
131 parallel tasks because these beasts need some collaboration between
132 the network and CPU model. That is why, ptask_07 is used by default
133 when using SimDag.
134   - \b default: Default workstation model. Currently, CPU:Cas01 and
135     network:LV08 (with cross traffic enabled)
136   - \b compound: Workstation model that is automatically chosen if
137     you change the network and CPU models
138   - \b ptask_L07: Workstation model somehow similar to Cas01+CM02 but
139     allowing parallel tasks
140
141 \subsection options_model_optim Optimization level of the platform models
142
143 The network and CPU models that are based on lmm_solve (that
144 is, all our analytical models) accept specific optimization
145 configurations.
146   - items \b network/optim and \b CPU/optim (both default to 'Lazy'):
147     - \b Lazy: Lazy action management (partial invalidation in lmm +
148       heap in action remaining).
149     - \b TI: Trace integration. Highly optimized mode when using
150       availability traces (only available for the Cas01 CPU model for
151       now).
152     - \b Full: Full update of remaining and variables. Slow but may be
153       useful when debugging.
154   - items \b network/maxmin_selective_update and
155     \b cpu/maxmin_selective_update: configure whether the underlying
156     should be lazily updated or not. It should have no impact on the
157     computed timings, but should speed up the computation.
158
159 It is still possible to disable the \c maxmin_selective_update feature
160 because it can reveal counter-productive in very specific scenarios
161 where the interaction level is high. In particular, if all your
162 communication share a given backbone link, you should disable it:
163 without \c maxmin_selective_update, every communications are updated
164 at each step through a simple loop over them. With that feature
165 enabled, every communications will still get updated in this case
166 (because of the dependency induced by the backbone), but through a
167 complicated pattern aiming at following the actual dependencies.
168
169 \subsection options_model_precision Numerical precision of the platform models
170
171 The analytical models handle a lot of floating point values. It is
172 possible to change the epsilon used to update and compare them through
173 the \b maxmin/precision item (default value: 0.00001). Changing it
174 may speedup the simulation by discarding very small actions, at the
175 price of a reduced numerical precision.
176
177 \subsection options_model_nthreads Parallel threads for model updates
178
179 By default, Surf computes the analytical models sequentially to share their
180 resources and update their actions. It is possible to run them in parallel,
181 using the \b surf/nthreads item (default value: 1). If you use a
182 negative or null value, the amount of available cores is automatically
183 detected  and used instead.
184
185 Depending on the workload of the models and their complexity, you may get a
186 speedup or a slowdown because of the synchronization costs of threads.
187
188 \subsection options_model_network Configuring the Network model
189
190 \subsubsection options_model_network_gamma Maximal TCP window size
191
192 The analytical models need to know the maximal TCP window size to take
193 the TCP congestion mechanism into account. This is set to 20000 by
194 default, but can be changed using the \b network/TCP_gamma item.
195
196 On linux, this value can be retrieved using the following
197 commands. Both give a set of values, and you should use the last one,
198 which is the maximal size.\verbatim
199 cat /proc/sys/net/ipv4/tcp_rmem # gives the sender window
200 cat /proc/sys/net/ipv4/tcp_wmem # gives the receiver window
201 \endverbatim
202
203 \subsubsection options_model_network_coefs Correcting important network parameters
204
205 SimGrid can take network irregularities such as a slow startup or
206 changing behavior depending on the message size into account.
207 You should not change these values unless you really know what you're doing.
208
209 The corresponding values were computed through data fitting one the
210 timings of packet-level simulators.
211
212 See
213 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>
214 for more information about these parameters.
215
216 If you are using the SMPI model, these correction coefficients are
217 themselves corrected by constant values depending on the size of the
218 exchange. Again, only hardcore experts should bother about this fact.
219
220 InfiniBand network behavior can be modeled through 3 parameters, as explained in
221 <a href="http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf">this PhD thesis</a>.
222 These factors can be changed through the following option:
223
224 \verbatim
225 smpi/IB_penalty_factors:"βe;βs;γs"
226 \endverbatim
227
228 By default SMPI uses factors computed on the Stampede Supercomputer at TACC, with optimal
229 deployment of processes on nodes.
230
231 \subsubsection options_model_network_crosstraffic Simulating cross-traffic
232
233 %As of SimGrid v3.7, cross-traffic effects can be taken into account in
234 analytical simulations. It means that ongoing and incoming
235 communication flows are treated independently. In addition, the LV08
236 model adds 0.05 of usage on the opposite direction for each new
237 created flow. This can be useful to simulate some important TCP
238 phenomena such as ack compression.
239
240 For that to work, your platform must have two links for each
241 pair of interconnected hosts. An example of usable platform is
242 available in <tt>examples/msg/gtnets/crosstraffic-p.xml</tt>.
243
244 This is activated through the \b network/crosstraffic item, that
245 can be set to 0 (disable this feature) or 1 (enable it).
246
247 Note that with the default workstation model this option is activated by default.
248
249 \subsubsection options_model_network_coord Coordinated-based network models
250
251 When you want to use network coordinates, as it happens when you use
252 an \<AS\> in your platform file with \c Vivaldi as a routing, you must
253 set the \b network/coordinates to \c yes so that all mandatory
254 initialization are done in the simulator.
255
256 \subsubsection options_model_network_sendergap Simulating sender gap
257
258 (this configuration item is experimental and may change or disapear)
259
260 It is possible to specify a timing gap between consecutive emission on
261 the same network card through the \b network/sender_gap item. This
262 is still under investigation as of writting, and the default value is
263 to wait 10 microseconds (1e-5 seconds) between emissions.
264
265 \subsubsection options_model_network_asyncsend Simulating asyncronous send
266
267 (this configuration item is experimental and may change or disapear)
268
269 It is possible to specify that messages below a certain size will be sent
270 as soon as the call to MPI_Send is issued, without waiting for the
271 correspondant receive. This threshold can be configured through the
272 \b smpi/async_small_thres item. The default value is 0. This behavior can also be
273 manually set for MSG mailboxes, by setting the receiving mode of the mailbox
274 with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this
275 mailbox will have this behavior, so consider using two mailboxes if needed.
276
277 This value needs to be smaller than or equals to the threshold set at
278 \ref options_model_smpi_detached , because asynchronous messages are
279 meant to be detached as well.
280
281 \subsubsection options_pls Configuring packet-level pseudo-models
282
283 When using the packet-level pseudo-models, several specific
284 configuration flags are provided to configure the associated tools.
285 There is by far not enough such SimGrid flags to cover every aspects
286 of the associated tools, since we only added the items that we
287 needed ourselves. Feel free to request more items (or even better:
288 provide patches adding more items).
289
290 When using NS3, the only existing item is \b ns3/TcpModel,
291 corresponding to the ns3::TcpL4Protocol::SocketType configuration item
292 in NS3. The only valid values (enforced on the SimGrid side) are
293 'NewReno' or 'Reno' or 'Tahoe'.
294
295 When using GTNeTS, two items exist:
296  - \b gtnets/jitter, that is a double value to oscillate
297    the link latency, uniformly in random interval
298    [-latency*gtnets_jitter,latency*gtnets_jitter). It defaults to 0.
299  - \b gtnets/jitter_seed, the positive seed used to reproduce jitted
300    results. Its value must be in [1,1e8] and defaults to 10.
301
302 \section options_modelchecking Configuring the Model-Checking
303
304 To enable the experimental SimGrid model-checking support the program should
305 be executed with the command line argument
306 \verbatim
307 --cfg=model-check:1
308 \endverbatim
309 Safety properties are expressed as assertions using the function
310 \verbatim
311 void MC_assert(int prop);
312 \endverbatim
313
314 \subsection options_modelchecking_liveness Specifying a liveness property
315
316 If you want to specify liveness properties (beware, that's
317 experimental), you have to pass them on the command line, specifying
318 the name of the file containing the property, as formatted by the
319 ltl2ba program.
320
321 \verbatim
322 --cfg=model-check/property:<filename>
323 \endverbatim
324
325 Of course, specifying a liveness property enables the model-checking
326 so that you don't have to give <tt>--cfg=model-check:1</tt> in
327 addition.
328
329 \subsection options_modelchecking_steps Going for stateful verification
330
331 By default, the system is backtracked to its initial state to explore
332 another path instead of backtracking to the exact step before the fork
333 that we want to explore (this is called stateless verification). This
334 is done this way because saving intermediate states can rapidly
335 exhaust the available memory. If you want, you can change the value of
336 the <tt>model-check/checkpoint</tt> variable. For example, the
337 following configuration will ask to take a checkpoint every step.
338 Beware, this will certainly explode your memory. Larger values are
339 probably better, make sure to experiment a bit to find the right
340 setting for your specific system.
341
342 \verbatim
343 --cfg=model-check/checkpoint:1
344 \endverbatim
345
346 Of course, specifying this option enables the model-checking so that
347 you don't have to give <tt>--cfg=model-check:1</tt> in addition.
348
349 \subsection options_modelchecking_reduction Specifying the kind of reduction
350
351 The main issue when using the model-checking is the state space
352 explosion. To counter that problem, several exploration reduction
353 techniques can be used. There is unfortunately no silver bullet here,
354 and the most efficient reduction techniques cannot be applied to any
355 properties. In particular, the DPOR method cannot be applied on
356 liveness properties since it may break some cycles in the exploration
357 that are important to the property validity.
358
359 \verbatim
360 --cfg=model-check/reduction:<technique>
361 \endverbatim
362
363 For now, this configuration variable can take 2 values:
364  * none: Do not apply any kind of reduction (mandatory for now for
365    liveness properties)
366  * dpor: Apply Dynamic Partial Ordering Reduction. Only valid if you
367    verify local safety properties.
368
369 Of course, specifying a reduction technique enables the model-checking
370 so that you don't have to give <tt>--cfg=model-check:1</tt> in
371 addition.
372
373 \subsection options_mc_perf Performance considerations for the model checker
374
375 The size of the stacks can have a huge impact on the memory
376 consumption when using model-checking. Currently each snapshot, will
377 save a copy of the whole stack and not only of the part which is
378 really meaningful: you should expect the contribution of the memory
379 consumption of the snapshots to be \f$ \mbox{number of processes}
380 \times \mbox{stack size} \times \mbox{number of states} \f$.
381
382 However, when compiled against the model checker, the stacks are not
383 protected with guards: if the stack size is too small for your
384 application, the stack will silently overflow on other parts of the
385 memory.
386
387 \section options_virt Configuring the User Process Virtualization
388
389 \subsection options_virt_factory Selecting the virtualization factory
390
391 In SimGrid, the user code is virtualized in a specific mecanism
392 allowing the simulation kernel to control its execution: when a user
393 process requires a blocking action (such as sending a message), it is
394 interrupted, and only gets released when the simulated clock reaches
395 the point where the blocking operation is done.
396
397 In SimGrid, the containers in which user processes are virtualized are
398 called contexts. Several context factory are provided, and you can
399 select the one you want to use with the \b contexts/factory
400 configuration item. Some of the following may not exist on your
401 machine because of portability issues. In any case, the default one
402 should be the most effcient one (please report bugs if the
403 auto-detection fails for you). They are sorted here from the slowest
404 to the most effient:
405  - \b thread: very slow factory using full featured threads (either
406    pthreads or windows native threads)
407  - \b ucontext: fast factory using System V contexts (or a portability
408    layer of our own on top of Windows fibers)
409  - \b raw: amazingly fast factory using a context switching mecanism
410    of our own, directly implemented in assembly (only available for x86
411    and amd64 platforms for now)
412
413 The only reason to change this setting is when the debugging tools get
414 fooled by the optimized context factories. Threads are the most
415 debugging-friendly contextes, as they allow to set breakpoints anywhere with gdb
416  and visualize backtraces for all processes, in order to debug concurrency issues.
417 Valgrind is also more comfortable with threads, but it should be usable with all factories.
418
419 \subsection options_virt_stacksize Adapting the used stack size
420
421 Each virtualized used process is executed using a specific system
422 stack. The size of this stack has a huge impact on the simulation
423 scalability, but its default value is rather large. This is because
424 the error messages that you get when the stack size is too small are
425 rather disturbing: this leads to stack overflow (overwriting other
426 stacks), leading to segfaults with corrupted stack traces.
427
428 If you want to push the scalability limits of your code, you might
429 want to reduce the \b contexts/stack_size item. Its default value
430 is 8192 (in KiB), while our Chord simulation works with stacks as small
431 as 16 KiB, for example. For the thread factory, the default value
432 is the one of the system, if it is too large/small, it has to be set
433 with this parameter.
434
435 The operating system should only allocate memory for the pages of the
436 stack which are actually used and you might not need to use this in
437 most cases. However, this setting is very important when using the
438 model checker (see \ref options_mc_perf).
439
440 In some cases, no stack guard page is used and the stack will silently
441 overflow on other parts of the memory if the stack size is too small
442 for your application. This happens :
443
444 - on Windows systems;
445 - when the model checker is enabled;
446 - when stack guard pages are explicitely disabled (see \ref  options_perf_guard_size).
447
448 \subsection options_virt_parallel Running user code in parallel
449
450 Parallel execution of the user code is only considered stable in
451 SimGrid v3.7 and higher. It is described in
452 <a href="http://hal.inria.fr/inria-00602216/">INRIA RR-7653</a>.
453
454 If you are using the \c ucontext or \c raw context factories, you can
455 request to execute the user code in parallel. Several threads are
456 launched, each of them handling as much user contexts at each run. To
457 actiave this, set the \b contexts/nthreads item to the amount of
458 cores that you have in your computer (or lower than 1 to have
459 the amount of cores auto-detected).
460
461 Even if you asked several worker threads using the previous option,
462 you can request to start the parallel execution (and pay the
463 associated synchronization costs) only if the potential parallelism is
464 large enough. For that, set the \b contexts/parallel_threshold
465 item to the minimal amount of user contexts needed to start the
466 parallel execution. In any given simulation round, if that amount is
467 not reached, the contexts will be run sequentially directly by the
468 main thread (thus saving the synchronization costs). Note that this
469 option is mainly useful when the grain of the user code is very fine,
470 because our synchronization is now very efficient.
471
472 When parallel execution is activated, you can choose the
473 synchronization schema used with the \b contexts/synchro item,
474 which value is either:
475  - \b futex: ultra optimized synchronisation schema, based on futexes
476    (fast user-mode mutexes), and thus only available on Linux systems.
477    This is the default mode when available.
478  - \b posix: slow but portable synchronisation using only POSIX
479    primitives.
480  - \b busy_wait: not really a synchronisation: the worker threads
481    constantly request new contexts to execute. It should be the most
482    efficient synchronisation schema, but it loads all the cores of your
483    machine for no good reason. You probably prefer the other less
484    eager schemas.
485
486 \section options_tracing Configuring the tracing subsystem
487
488 The \ref tracing "tracing subsystem" can be configured in several
489 different ways depending on the nature of the simulator (MSG, SimDag,
490 SMPI) and the kind of traces that need to be obtained. See the \ref
491 tracing_tracing_options "Tracing Configuration Options subsection" to
492 get a detailed description of each configuration option.
493
494 We detail here a simple way to get the traces working for you, even if
495 you never used the tracing API.
496
497
498 - Any SimGrid-based simulator (MSG, SimDag, SMPI, ...) and raw traces:
499 \verbatim
500 --cfg=tracing:yes --cfg=tracing/uncategorized:yes --cfg=triva/uncategorized:uncat.plist
501 \endverbatim
502     The first parameter activates the tracing subsystem, the second
503     tells it to trace host and link utilization (without any
504     categorization) and the third creates a graph configuration file
505     to configure Triva when analysing the resulting trace file.
506
507 - MSG or SimDag-based simulator and categorized traces (you need to declare categories and classify your tasks according to them)
508 \verbatim
509 --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=triva/categorized:cat.plist
510 \endverbatim
511     The first parameter activates the tracing subsystem, the second
512     tells it to trace host and link categorized utilization and the
513     third creates a graph configuration file to configure Triva when
514     analysing the resulting trace file.
515
516 - SMPI simulator and traces for a space/time view:
517 \verbatim
518 smpirun -trace ...
519 \endverbatim
520     The <i>-trace</i> parameter for the smpirun script runs the
521 simulation with --cfg=tracing:yes and --cfg=tracing/smpi:yes. Check the
522 smpirun's <i>-help</i> parameter for additional tracing options.
523
524 Sometimes you might want to put additional information on the trace to
525 correctly identify them later, or to provide data that can be used to
526 reproduce an experiment. You have two ways to do that:
527
528 - Add a string on top of the trace file as comment:
529 \verbatim
530 --cfg=tracing/comment:my_simulation_identifier
531 \endverbatim
532
533 - Add the contents of a textual file on top of the trace file as comment:
534 \verbatim
535 --cfg=tracing/comment_file:my_file_with_additional_information.txt
536 \endverbatim
537
538 Please, use these two parameters (for comments) to make reproducible
539 simulations. For additional details about this and all tracing
540 options, check See the \ref tracing_tracing_options.
541
542 \section options_smpi Configuring SMPI
543
544 The SMPI interface provides several specific configuration items.
545 These are uneasy to see since the code is usually launched through the
546 \c smiprun script directly.
547
548 \subsection options_smpi_bench smpi/bench: Automatic benchmarking of SMPI code
549
550 In SMPI, the sequential code is automatically benchmarked, and these
551 computations are automatically reported to the simulator. That is to
552 say that if you have a large computation between a \c MPI_Recv() and a
553 \c MPI_Send(), SMPI will automatically benchmark the duration of this
554 code, and create an execution task within the simulator to take this
555 into account. For that, the actual duration is measured on the host
556 machine and then scaled to the power of the corresponding simulated
557 machine. The variable \b smpi/running_power allows to specify the
558 computational power of the host machine (in flop/s) to use when
559 scaling the execution times. It defaults to 20000, but you really want
560 to update it to get accurate simulation results.
561
562 When the code is constituted of numerous consecutive MPI calls, the
563 previous mechanism feeds the simulation kernel with numerous tiny
564 computations. The \b smpi/cpu_threshold item becomes handy when this
565 impacts badly the simulation performance. It specify a threshold (in
566 second) under which the execution chunks are not reported to the
567 simulation kernel (default value: 1e-6). Please note that in some
568 circonstances, this optimization can hinder the simulation accuracy.
569
570  In some cases, however, one may wish to disable simulation of
571 application computation. This is the case when SMPI is used not to
572 simulate an MPI applications, but instead an MPI code that performs
573 "live replay" of another MPI app (e.g., ScalaTrace's replay tool,
574 various on-line simulators that run an app at scale). In this case the
575 computation of the replay/simulation logic should not be simulated by
576 SMPI. Instead, the replay tool or on-line simulator will issue
577 "computation events", which correspond to the actual MPI simulation
578 being replayed/simulated. At the moment, these computation events can
579 be simulated using SMPI by calling internal smpi_execute*() functions.
580
581 To disable the benchmarking/simulation of computation in the simulated
582 application, the variable \b
583 smpi/simulation_computation should be set to no
584
585 \subsection options_model_smpi_bw_factor smpi/bw_factor: Bandwidth factors
586
587 The possible throughput of network links is often dependent on the
588 message sizes, as protocols may adapt to different message sizes. With
589 this option, a series of message sizes and factors are given, helping
590 the simulation to be more realistic. For instance, the current
591 default value is
592
593 \verbatim
594 65472:0.940694;15424:0.697866;9376:0.58729;5776:1.08739;3484:0.77493;1426:0.608902;732:0.341987;257:0.338112;0:0.812084
595 \endverbatim
596
597 So, messages with size 65472 and more will get a total of MAX_BANDWIDTH*0.940694,
598 messages of size 15424 to 65471 will get MAX_BANDWIDTH*0.697866 and so on.
599 Here, MAX_BANDWIDTH denotes the bandwidth of the link.
600
601 \subsection options_smpi_timing smpi/display_timing: Reporting simulation time
602
603 Most of the time, you run MPI code through SMPI to compute the time it
604 would take to run it on a platform that you don't have. But since the
605 code is run through the \c smpirun script, you don't have any control
606 on the launcher code, making difficult to report the simulated time
607 when the simulation ends. If you set the \b smpi/display_timing item
608 to 1, \c smpirun will display this information when the simulation ends. \verbatim
609 Simulation time: 1e3 seconds.
610 \endverbatim
611
612 \subsection options_model_smpi_lat_factor smpi/lat_factor: Latency factors
613
614 The motivation and syntax for this option is identical to the motivation/syntax
615 of smpi/bw_factor, see \ref options_model_smpi_bw_factor for details.
616
617 There is an important difference, though: While smpi/bw_factor \a reduces the
618 actual bandwidth (i.e., values between 0 and 1 are valid), latency factors
619 increase the latency, i.e., values larger than or equal to 1 are valid here.
620
621 This is the default value:
622
623 \verbatim
624 65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;1426:1.61075;732:1.9503;257:1.95341;0:2.01467
625 \endverbatim
626
627 \subsection options_smpi_global smpi/privatize_global_variables: Automatic privatization of global variables
628
629 MPI executables are meant to be executed in separated processes, but SMPI is
630 executed in only one process. Global variables from executables will be placed
631 in the same memory zone and shared between processes, causing hard to find bugs.
632 To avoid this, several options are possible :
633   - Manual edition of the code, for example to add __thread keyword before data
634   declaration, which allows the resulting code to work with SMPI, but only
635   if the thread factory (see \ref options_virt_factory) is used, as global
636   variables are then placed in the TLS (thread local storage) segment.
637   - Source-to-source transformation, to add a level of indirection
638   to the global variables. SMPI does this for F77 codes compiled with smpiff,
639   and used to provide coccinelle scripts for C codes, which are not functional anymore.
640   - Compilation pass, to have the compiler automatically put the data in
641   an adapted zone.
642   - Runtime automatic switching of the data segments. SMPI stores a copy of
643   each global data segment for each process, and at each context switch replaces
644   the actual data with its copy from the right process. This mechanism uses mmap,
645   and is for now limited to systems supporting this functionnality (all Linux
646   and some BSD should be compatible).
647   Another limitation is that SMPI only accounts for global variables defined in
648   the executable. If the processes use external global variables from dynamic
649   libraries, they won't be switched correctly. To avoid this, using static
650   linking is advised (but not with the simgrid library, to avoid replicating
651   its own global variables).
652
653   To use this runtime automatic switching, the variable \b smpi/privatize_global_variables
654   should be set to yes
655
656
657
658 \subsection options_model_smpi_detached Simulating MPI detached send
659
660 This threshold specifies the size in bytes under which the send will return
661 immediately. This is different from the threshold detailed in  \ref options_model_network_asyncsend
662 because the message is not effectively sent when the send is posted. SMPI still waits for the
663 correspondant receive to be posted to perform the communication operation. This threshold can be set
664 by changing the \b smpi/send_is_detached item. The default value is 65536.
665
666 \subsection options_model_smpi_collectives Simulating MPI collective algorithms
667
668 SMPI implements more than 100 different algorithms for MPI collective communication, to accurately
669 simulate the behavior of most of the existing MPI libraries. The \b smpi/coll_selector item can be used
670  to use the decision logic of either OpenMPI or MPICH libraries (values: ompi or mpich, by default SMPI
671 uses naive version of collective operations). Each collective operation can be manually selected with a
672 \b smpi/collective_name:algo_name. Available algorithms are listed in \ref SMPI_collective_algorithms .
673
674 \subsection options_model_smpi_iprobe smpi/iprobe: Inject constant times for calls to MPI_Iprobe
675
676 \b Default value: 0.0001
677
678 The behavior and motivation for this configuration option is identical with \a smpi/test, see
679 Section \ref options_model_smpi_test for details.
680
681 \subsection options_model_smpi_test smpi/test: Inject constant times for calls to MPI_Test
682
683 \b Default value: 0.0001
684
685 By setting this option, you can control the amount of time a process sleeps
686 when MPI_Test() is called; this is important, because SimGrid normally only
687 advances the time while communication is happening and thus,
688 MPI_Test will not add to the time, resulting in a deadlock if used as a
689 break-condition.
690
691 Here is an example:
692
693 \code{.unparsed}
694     while(!flag) {
695         MPI_Test(request, flag, status);
696         ...
697     }
698 \endcode
699
700 \note
701     Internally, in order to speed up execution, we use a counter to keep track
702     on how often we already checked if the handle is now valid or not. Hence, we
703     actually use counter*SLEEP_TIME, that is, the time MPI_Test() causes the process
704     to sleep increases linearly with the number of previously failed testk.
705
706
707 \subsection options_model_smpi_wtime smpi/wtime: Inject constant times for calls to MPI_Wtime
708
709 \b Default value: 0
710
711 By setting this option, you can control the amount of time a process sleeps
712 when MPI_Wtime() is called; this is important, because SimGrid normally only
713 advances the time while communication is happening and thus,
714 MPI_Wtime will not add to the time, resulting in a deadlock if used as a
715 break-condition.
716
717 Here is an example:
718
719 \code{.unparsed}
720     while(MPI_Wtime() < some_time_bound) {
721         ...
722     }
723 \endcode
724
725 If the time is never advanced, this loop will clearly never end as MPI_Wtime()
726 always returns the same value. Hence, pass a (small) value to the smpi/wtime
727 option to force a call to MPI_Wtime to advance the time as well.
728
729
730 \section options_generic Configuring other aspects of SimGrid
731
732 \subsection options_generic_clean_atexit Cleanup before termination
733
734 The C / C++ standard contains a function called \b [atexit](http://www.cplusplus.com/reference/cstdlib/atexit/).
735 atexit registers callbacks, which are called just before the program terminates.
736
737 By setting the configuration option clean_atexit to 1 (true), a callback
738 is registered and will clean up some variables and terminate/cleanup the tracing.
739
740 TODO: Add when this should be used.
741
742 \subsection options_generic_path XML file inclusion path
743
744 It is possible to specify a list of directories to search into for the
745 \<include\> tag in XML files by using the \b path configuration
746 item. To add several directory to the path, set the configuration
747 item several times, as in \verbatim
748 --cfg=path:toto --cfg=path:tutu
749 \endverbatim
750
751 \subsection options_generic_exit Behavior on Ctrl-C
752
753 By default, when Ctrl-C is pressed, the status of all existing
754 simulated processes is displayed before exiting the simulation. This is very useful to debug your
755 code, but it can reveal troublesome in some cases (such as when the
756 amount of processes becomes really big). This behavior is disabled
757 when \b verbose-exit is set to 0 (it is to 1 by default).
758
759 \subsection options_exception_cutpath Truncate local path from exception backtrace
760
761 <b>This configuration option is an internal option and should normally not be used
762 by the user.</b> It is used to remove the path from the backtrace
763 shown when an exception is thrown; if we didn't remove this part, the tests
764 testing the exception parts of simgrid would fail on most machines, as we are
765 currently comparing output. Clearly, the path used on different machines are almost
766 guaranteed to be different and hence, the output would
767 mismatch, causing the test to fail.
768
769 \section options_log Logging Configuration
770
771 It can be done by using XBT. Go to \ref XBT_log for more details.
772
773 \section options_perf Performance optimizations
774
775 \subsection options_perf_context Context factory
776
777 In order to achieve higher performance, you might want to use the raw
778 context factory which avoids any system call when switching between
779 tasks. If it is not possible you might use ucontext instead.
780
781 \subsection options_perf_guard_size Disabling stack guard pages
782
783 A stack guard page is usually used which prevents the stack from
784 overflowing on other parts of the memory. However this might have a
785 performance impact if a huge number of processes is created.  The
786 option \b contexts:guard_size is the number of stack guard pages
787 used. By setting it to 0, no guard pages will be used: in this case,
788 you should avoid using small stacks (\b stack_size) as the stack will
789 silently overflow on other parts of the memory.
790
791 \section options_index Index of all existing configuration options
792
793 \note
794   Almost all options are defined in <i>src/simgrid/sg_config.c</i>. You may
795   want to check this file, too, but this index should be somewhat complete
796   for the moment (May 2015).
797
798 \note
799   \b Please \b note: You can also pass the command-line option "\b --help" and
800      "--help-cfg" to an executable that uses simgrid.
801
802 - \c clean_atexit: \ref options_generic_clean_atexit
803
804 - \c contexts/factory: \ref options_virt_factory
805 - \c contexts/guard_size: \ref options_virt_parallel
806 - \c contexts/nthreads: \ref options_virt_parallel
807 - \c contexts/parallel_threshold: \ref options_virt_parallel
808 - \c contexts/stack_size: \ref options_virt_stacksize
809 - \c contexts/synchro: \ref options_virt_parallel
810
811 - \c cpu/maxmin_selective_update: \ref options_model_optim
812 - \c cpu/model: \ref options_model_select
813 - \c cpu/optim: \ref options_model_optim
814
815 - \c exception/cutpath: \ref options_exception_cutpath
816
817 - \c gtnets/jitter: \ref options_pls
818 - \c gtnets/jitter_seed: \ref options_pls
819
820 - \c maxmin/precision: \ref options_model_precision
821
822 - \c msg/debug_multiple_use: \ref options_msg_debug_multiple_use
823
824 - \c model-check: \ref options_modelchecking
825 - \c model-check/checkpoint: \ref options_modelchecking_steps
826 - \c model-check/communications_determinism: \ref options_modelchecking_comm_determinism
827 - \c model-check/dot_output: \ref options_modelchecking_dot_output
828 - \c model-check/hash: \ref options_modelchecking_hash
829 - \c model-check/property: \ref options_modelchecking_liveness
830 - \c model-check/max_depth: \ref options_modelchecking_max_depth
831 - \c model-check/record: \ref options_modelchecking_record
832 - \c model-check/reduction: \ref options_modelchecking_reduction
833 - \c model-check/replay: \ref options_modelchecking_replay
834 - \c model-check/send_determinism: \ref options_modelchecking_sparse_checkpoint
835 - \c model-check/snapshot_fds: \ref options_modelchecking_snapshot_fds
836 - \c model-check/sparse-checkpoint: \ref options_modelchecking_sparse_checkpoint
837 - \c model-check/termination: \ref options_modelchecking_termination
838 - \c model-check/timeout: \ref options_modelchecking_timeout
839 - \c model-check/visited: \ref options_modelchecking_visited
840
841 - \c network/bandwidth_factor: \ref options_model_network_coefs
842 - \c network/coordinates: \ref options_model_network_coord
843 - \c network/crosstraffic: \ref options_model_network_crosstraffic
844 - \c network/latency_factor: \ref options_model_network_coefs
845 - \c network/maxmin_selective_update: \ref options_model_optim
846 - \c network/model: \ref options_model_select
847 - \c network/optim: \ref options_model_optim
848 - \c network/sender_gap: \ref options_model_network_sendergap
849 - \c network/TCP_gamma: \ref options_model_network_gamma
850 - \c network/weight_S: \ref options_model_network_coefs
851
852 - \c ns3/TcpModel: \ref options_pls
853
854 - \c surf/nthreads: \ref options_model_nthreads
855 - \c surf/precision: \ref options_model_precision
856
857 - \c <b>For collective operations of SMPI, please refer to Section \ref options_index_smpi_coll</b>
858 - \c smpi/async_small_thres: \ref options_model_network_asyncsend
859 - \c smpi/bw_factor: \ref options_model_smpi_bw_factor
860 - \c smpi/coll_selector: \ref options_model_smpi_collectives
861 - \c smpi/cpu_threshold: \ref options_smpi_bench
862 - \c smpi/display_timing: \ref options_smpi_timing
863 - \c smpi/lat_factor: \ref options_model_smpi_lat_factor
864 - \c smpi/IB_penalty_factors: \ref options_model_network_coefs
865 - \c smpi/iprobe: \ref options_model_smpi_iprobe
866 - \c smpi/ois: \ref options_model_smpi_ois
867 - \c smpi/or: \ref options_model_smpi_or
868 - \c smpi/os: \ref options_model_smpi_os
869 - \c smpi/privatize_global_variables: \ref options_smpi_global
870 - \c smpi/running_power: \ref options_smpi_bench
871 - \c smpi/send_is_detached_thresh: \ref options_model_smpi_detached
872 - \c smpi/simulation_computation: \ref options_smpi_bench
873 - \c smpi/test: \ref options_model_smpi_test
874 - \c smpi/use_shared_malloc: \ref options_model_smpi_use_shared_malloc
875 - \c smpi/wtime: \ref options_model_smpi_wtime
876
877 - \c <b>Tracing configuration options can be found in Section \ref tracing_tracing_options</b>.
878
879 - \c storage/model: \ref options_storage_model
880 - \c path: \ref options_generic_path
881 - \c plugin: \ref options_generic_plugin
882 - \c verbose-exit: \ref options_generic_exit
883
884 - \c vm_workstation/model: \ref options_vm_workstation_model
885 - \c workstation/model: \ref options_model_select
886
887 \subsection options_index_smpi_coll Index of SMPI collective algorithms options
888 - \c smpi/allgather: \ref options_model_smpi_coll_allgather
889 - \c smpi/allgatherv: \ref options_model_smpi_coll_allgatherv
890 - \c smpi/allreduce: \ref options_model_smpi_coll_allreduce
891 - \c smpi/alltoall: \ref options_model_smpi_coll_alltoall
892 - \c smpi/alltoallv: \ref options_model_smpi_coll_alltoallv
893 - \c smpi/barrier: \ref options_model_smpi_coll_barrier
894 - \c smpi/bcast: \ref options_model_smpi_coll_bcast
895 - \c smpi/gather: \ref options_model_smpi_coll_gather
896 - \c smpi/reduce: \ref options_model_smpi_coll_reduce
897 - \c smpi/reduce_scatter: \ref options_model_smpi_coll_reduce_scatter
898 - \c smpi/scatter: \ref options_model_smpi_coll_scatter
899
900 */