Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
82776a5768589b5b3dc0d7b99fa951e9e9914bf3
[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 writting, the accepted network models are the following. 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 CM02: Legacy network analytic model (Very similar to LV08, but
99     without corrective factors. The timings of small messages are thus
100     poorly modeled)
101   - \b Reno: Model from Steven H. Low using lagrange_solve instead of
102     lmm_solve (experts only; check the code for more info).
103   - \b Reno2: Model from Steven H. Low using lagrange_solve instead of
104     lmm_solve (experts only; check the code for more info).
105   - \b Vegas: Model from Steven H. Low using lagrange_solve instead of
106     lmm_solve (experts only; check the code for more info).
107
108 If you compiled SimGrid accordingly, you can use packet-level network
109 simulators as network models (see \ref pls). In that case, you have
110 two extra models, described below, and some \ref options_pls "specific
111 additional configuration flags".
112   - \b GTNets: Network pseudo-model using the GTNets simulator instead
113     of an analytic model
114   - \b NS3: Network pseudo-model using the NS3 tcp model instead of an
115     analytic model
116
117 Concerning the CPU, we have only one model for now:
118   - \b Cas01: Simplistic CPU model (time=size/power)
119
120 The workstation concept is the aggregation of a CPU with a network
121 card. Three models exists, but actually, only 2 of them are
122 interesting. The "compound" one is simply due to the way our internal
123 code is organized, and can easily be ignored. So at the end, you have
124 two workstation models: The default one allows to aggregate an
125 existing CPU model with an existing network model, but does not allow
126 parallel tasks because these beasts need some collaboration between
127 the network and CPU model. That is why, ptask_07 is used by default
128 when using SimDag.
129   - \b default: Default workstation model. Currently, CPU:Cas01 and
130     network:LV08 (with cross traffic enabled)
131   - \b compound: Workstation model that is automatically chosen if
132     you change the network and CPU models
133   - \b ptask_L07: Workstation model somehow similar to Cas01+CM02 but
134     allowing parallel tasks
135
136 \subsection options_model_optim Optimization level of the platform models
137
138 The network and CPU models that are based on lmm_solve (that
139 is, all our analytical models) accept specific optimization
140 configurations.
141   - items \b network/optim and \b CPU/optim (both default to 'Lazy'):
142     - \b Lazy: Lazy action management (partial invalidation in lmm +
143       heap in action remaining).
144     - \b TI: Trace integration. Highly optimized mode when using
145       availability traces (only available for the Cas01 CPU model for
146       now).
147     - \b Full: Full update of remaining and variables. Slow but may be
148       useful when debugging.
149   - items \b network/maxmin_selective_update and
150     \b cpu/maxmin_selective_update: configure whether the underlying
151     should be lazily updated or not. It should have no impact on the
152     computed timings, but should speed up the computation.
153
154 It is still possible to disable the \c maxmin_selective_update feature
155 because it can reveal counter-productive in very specific scenarios
156 where the interaction level is high. In particular, if all your
157 communication share a given backbone link, you should disable it:
158 without \c maxmin_selective_update, every communications are updated
159 at each step through a simple loop over them. With that feature
160 enabled, every communications will still get updated in this case
161 (because of the dependency induced by the backbone), but through a
162 complicated pattern aiming at following the actual dependencies.
163
164 \subsection options_model_precision Numerical precision of the platform models
165
166 The analytical models handle a lot of floating point values. It is
167 possible to change the epsilon used to update and compare them through
168 the \b maxmin/precision item (default value: 0.00001). Changing it
169 may speedup the simulation by discarding very small actions, at the
170 price of a reduced numerical precision.
171
172 \subsection options_model_nthreads Parallel threads for model updates
173
174 By default, Surf computes the analytical models sequentially to share their
175 resources and update their actions. It is possible to run them in parallel,
176 using the \b surf/nthreads item (default value: 1). If you use a
177 negative or null value, the amount of available cores is automatically
178 detected  and used instead.
179
180 Depending on the workload of the models and their complexity, you may get a
181 speedup or a slowdown because of the synchronization costs of threads.
182
183 \subsection options_model_network Configuring the Network model
184
185 \subsubsection options_model_network_gamma Maximal TCP window size
186
187 The analytical models need to know the maximal TCP window size to take
188 the TCP congestion mechanism into account. This is set to 20000 by
189 default, but can be changed using the \b network/TCP_gamma item.
190
191 On linux, this value can be retrieved using the following
192 commands. Both give a set of values, and you should use the last one,
193 which is the maximal size.\verbatim
194 cat /proc/sys/net/ipv4/tcp_rmem # gives the sender window
195 cat /proc/sys/net/ipv4/tcp_wmem # gives the receiver window
196 \endverbatim
197
198 \subsubsection options_model_network_coefs Corrective simulation factors
199
200 These factors allow to betterly take the slow start into account.
201 The corresponding values were computed through data fitting one the
202 timings of packet-level simulators. You should not change these values
203 unless you are really certain of what you are doing. See
204 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>
205 for more informations about these coeficients.
206
207 If you are using the SMPI model, these correction coeficients are
208 themselves corrected by constant values depending on the size of the
209 exchange. Again, only hardcore experts should bother about this fact.
210
211 \subsubsection options_model_network_crosstraffic Simulating cross-traffic
212
213 As of SimGrid v3.7, cross-traffic effects can be taken into account in
214 analytical simulations. It means that ongoing and incoming
215 communication flows are treated independently. In addition, the LV08
216 model adds 0.05 of usage on the opposite direction for each new
217 created flow. This can be useful to simulate some important TCP
218 phenomena such as ack compression.
219
220 For that to work, your platform must have two links for each
221 pair of interconnected hosts. An example of usable platform is
222 available in <tt>examples/msg/gtnets/crosstraffic-p.xml</tt>.
223
224 This is activated through the \b network/crosstraffic item, that
225 can be set to 0 (disable this feature) or 1 (enable it).
226
227 Note that with the default workstation model this option is activated by default.
228
229 \subsubsection options_model_network_coord Coordinated-based network models
230
231 When you want to use network coordinates, as it happens when you use
232 an \<AS\> in your platform file with \c Vivaldi as a routing, you must
233 set the \b network/coordinates to \c yes so that all mandatory
234 initialization are done in the simulator.
235
236 \subsubsection options_model_network_sendergap Simulating sender gap
237
238 (this configuration item is experimental and may change or disapear)
239
240 It is possible to specify a timing gap between consecutive emission on
241 the same network card through the \b network/sender_gap item. This
242 is still under investigation as of writting, and the default value is
243 to wait 10 microseconds (1e-5 seconds) between emissions.
244
245 \subsubsection options_model_network_asyncsend Simulating asyncronous send
246
247 (this configuration item is experimental and may change or disapear)
248
249 It is possible to specify that messages below a certain size will be sent 
250 as soon as the call to MPI_Send is issued, without waiting for the 
251 correspondant receive. This threshold can be configured through the 
252 \b smpi/async_small_thres item. The default value is 0. This behavior can also be 
253 manually set for MSG mailboxes, by setting the receiving mode of the mailbox 
254 with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this 
255 mailbox will have this behavior, so consider using two mailboxes if needed. 
256
257 This value needs to be smaller than or equals to the threshold set at 
258 \ref options_model_smpi_detached , because asynchronous messages are 
259 meant to be detached as well.
260
261 \subsubsection options_pls Configuring packet-level pseudo-models
262
263 When using the packet-level pseudo-models, several specific
264 configuration flags are provided to configure the associated tools.
265 There is by far not enough such SimGrid flags to cover every aspects
266 of the associated tools, since we only added the items that we
267 needed ourselves. Feel free to request more items (or even better:
268 provide patches adding more items).
269
270 When using NS3, the only existing item is \b ns3/TcpModel,
271 corresponding to the ns3::TcpL4Protocol::SocketType configuration item
272 in NS3. The only valid values (enforced on the SimGrid side) are
273 'NewReno' or 'Reno' or 'Tahoe'.
274
275 When using GTNeTS, two items exist:
276  - \b gtnets/jitter, that is a double value to oscillate
277    the link latency, uniformly in random interval
278    [-latency*gtnets_jitter,latency*gtnets_jitter). It defaults to 0.
279  - \b gtnets/jitter_seed, the positive seed used to reproduce jitted
280    results. Its value must be in [1,1e8] and defaults to 10.
281
282 \section options_modelchecking Configuring the Model-Checking
283
284 To enable the experimental SimGrid model-checking support the program should
285 be executed with the command line argument
286 \verbatim
287 --cfg=model-check:1
288 \endverbatim
289 Safety properties are expressed as assertions using the function
290 \verbatim
291 void MC_assert(int prop);
292 \endverbatim
293
294 \subsection options_modelchecking_liveness Specifying a liveness property
295
296 If you want to specify liveness properties (beware, that's
297 experimental), you have to pass them on the command line, specifying
298 the name of the file containing the property, as formated by the
299 ltl2ba program.
300
301 \verbatim
302 --cfg=model-check/property:<filename>
303 \endverbatim
304
305 Of course, specifying a liveness property enables the model-checking
306 so that you don't have to give <tt>--cfg=model-check:1</tt> in
307 addition.
308
309 \subsection options_modelchecking_steps Going for stateful verification
310
311 By default, the system is backtracked to its initial state to explore
312 another path instead of backtracking to the exact step before the fork
313 that we want to explore (this is called stateless verification). This
314 is done this way because saving intermediate states can rapidly
315 exhaust the available memory. If you want, you can change the value of
316 the <tt>model-check/checkpoint</tt> variable. For example, the
317 following configuration will ask to take a checkpoint every step.
318 Beware, this will certainly explode your memory. Larger values are
319 probably better, make sure to experiment a bit to find the right
320 setting for your specific system.
321
322 \verbatim
323 --cfg=model-check/checkpoint:1
324 \endverbatim
325
326 Of course, specifying this option enables the model-checking so that
327 you don't have to give <tt>--cfg=model-check:1</tt> in addition.
328
329 \subsection options_modelchecking_reduction Specifying the kind of reduction
330
331 The main issue when using the model-checking is the state space
332 explosion. To counter that problem, several exploration reduction
333 techniques can be used. There is unfortunately no silver bullet here,
334 and the most efficient reduction techniques cannot be applied to any
335 properties. In particular, the DPOR method cannot be applied on
336 liveness properties since it may break some cycles in the exploration
337 that are important to the property validity.
338
339 \verbatim
340 --cfg=model-check/reduction:<technique>
341 \endverbatim
342
343 For now, this configuration variable can take 2 values:
344  * none: Do not apply any kind of reduction (mandatory for now for
345    liveness properties)
346  * dpor: Apply Dynamic Partial Ordering Reduction. Only valid if you
347    verify local safety properties.
348
349 Of course, specifying a reduction technique enables the model-checking
350 so that you don't have to give <tt>--cfg=model-check:1</tt> in
351 addition.
352
353 \subsection options_mc_perf Performance considerations for the model checker
354
355 The size of the stacks can have a huge impact on the memory
356 consumption when using model-checking. Currently each snapshot, will
357 save a copy of the whole stack and not only of the part which is
358 really meaningful: you should expect the contribution of the memory
359 consumption of the snapshots to be \f$ \mbox{number of processes}
360 \times \mbox{stack size} \times \mbox{number of states} \f$.
361
362 However, when compiled against the model checker, the stacks are not
363 protected with guards: if the stack size is too small for your
364 application, the stack will silently overflow on other parts of the
365 memory.
366
367 \section options_virt Configuring the User Process Virtualization
368
369 \subsection options_virt_factory Selecting the virtualization factory
370
371 In SimGrid, the user code is virtualized in a specific mecanism
372 allowing the simulation kernel to control its execution: when a user
373 process requires a blocking action (such as sending a message), it is
374 interrupted, and only gets released when the simulated clock reaches
375 the point where the blocking operation is done.
376
377 In SimGrid, the containers in which user processes are virtualized are
378 called contexts. Several context factory are provided, and you can
379 select the one you want to use with the \b contexts/factory
380 configuration item. Some of the following may not exist on your
381 machine because of portability issues. In any case, the default one
382 should be the most effcient one (please report bugs if the
383 auto-detection fails for you). They are sorted here from the slowest
384 to the most effient:
385  - \b thread: very slow factory using full featured threads (either
386    pthreads or windows native threads)
387  - \b ucontext: fast factory using System V contexts (or a portability
388    layer of our own on top of Windows fibers)
389  - \b raw: amazingly fast factory using a context switching mecanism
390    of our own, directly implemented in assembly (only available for x86
391    and amd64 platforms for now)
392
393 The only reason to change this setting is when the debugging tools get
394 fooled by the optimized context factories. Threads are the most
395 debugging-friendly contextes, as they allow to set breakpoints anywhere with gdb
396  and visualize backtraces for all processes, in order to debug concurrency issues.
397 Valgrind is also more comfortable with threads, but it should be usable with all factories.
398
399 \subsection options_virt_stacksize Adapting the used stack size
400
401 Each virtualized used process is executed using a specific system
402 stack. The size of this stack has a huge impact on the simulation
403 scalability, but its default value is rather large. This is because
404 the error messages that you get when the stack size is too small are
405 rather disturbing: this leads to stack overflow (overwriting other
406 stacks), leading to segfaults with corrupted stack traces.
407
408 If you want to push the scalability limits of your code, you might
409 want to reduce the \b contexts/stack_size item. Its default value
410 is 8192 (in KiB), while our Chord simulation works with stacks as small
411 as 16 KiB, for example. For the thread factory, the default value 
412 is the one of the system, if it is too large/small, it has to be set 
413 with this parameter.
414
415 The operating system should only allocate memory for the pages of the
416 stack which are actually used and you might not need to use this in
417 most cases. However, this setting is very important when using the
418 model checker (see \ref options_mc_perf).
419
420 In some cases, no stack guard page is used and the stack will silently
421 overflow on other parts of the memory if the stack size is too small
422 for your application. This happens :
423
424 - on Windows systems;
425 - when the model checker is enabled;
426 - when stack guard pages are explicitely disabled (see \ref  options_perf_guard_size).
427
428 \subsection options_virt_parallel Running user code in parallel
429
430 Parallel execution of the user code is only considered stable in
431 SimGrid v3.7 and higher. It is described in
432 <a href="http://hal.inria.fr/inria-00602216/">INRIA RR-7653</a>.
433
434 If you are using the \c ucontext or \c raw context factories, you can
435 request to execute the user code in parallel. Several threads are
436 launched, each of them handling as much user contexts at each run. To
437 actiave this, set the \b contexts/nthreads item to the amount of
438 cores that you have in your computer (or lower than 1 to have 
439 the amount of cores auto-detected).
440
441 Even if you asked several worker threads using the previous option,
442 you can request to start the parallel execution (and pay the
443 associated synchronization costs) only if the potential parallelism is
444 large enough. For that, set the \b contexts/parallel_threshold
445 item to the minimal amount of user contexts needed to start the
446 parallel execution. In any given simulation round, if that amount is
447 not reached, the contexts will be run sequentially directly by the
448 main thread (thus saving the synchronization costs). Note that this
449 option is mainly useful when the grain of the user code is very fine,
450 because our synchronization is now very efficient.
451
452 When parallel execution is activated, you can choose the
453 synchronization schema used with the \b contexts/synchro item,
454 which value is either:
455  - \b futex: ultra optimized synchronisation schema, based on futexes
456    (fast user-mode mutexes), and thus only available on Linux systems.
457    This is the default mode when available.
458  - \b posix: slow but portable synchronisation using only POSIX
459    primitives.
460  - \b busy_wait: not really a synchronisation: the worker threads
461    constantly request new contexts to execute. It should be the most
462    efficient synchronisation schema, but it loads all the cores of your
463    machine for no good reason. You probably prefer the other less
464    eager schemas.
465
466 \section options_tracing Configuring the tracing subsystem
467
468 The \ref tracing "tracing subsystem" can be configured in several
469 different ways depending on the nature of the simulator (MSG, SimDag,
470 SMPI) and the kind of traces that need to be obtained. See the \ref
471 tracing_tracing_options "Tracing Configuration Options subsection" to
472 get a detailed description of each configuration option.
473
474 We detail here a simple way to get the traces working for you, even if
475 you never used the tracing API.
476
477
478 - Any SimGrid-based simulator (MSG, SimDag, SMPI, ...) and raw traces:
479 \verbatim
480 --cfg=tracing:yes --cfg=tracing/uncategorized:yes --cfg=triva/uncategorized:uncat.plist
481 \endverbatim
482     The first parameter activates the tracing subsystem, the second
483     tells it to trace host and link utilization (without any
484     categorization) and the third creates a graph configuration file
485     to configure Triva when analysing the resulting trace file.
486
487 - MSG or SimDag-based simulator and categorized traces (you need to declare categories and classify your tasks according to them)
488 \verbatim
489 --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=triva/categorized:cat.plist
490 \endverbatim
491     The first parameter activates the tracing subsystem, the second
492     tells it to trace host and link categorized utilization and the
493     third creates a graph configuration file to configure Triva when
494     analysing the resulting trace file.
495
496 - SMPI simulator and traces for a space/time view:
497 \verbatim
498 smpirun -trace ...
499 \endverbatim
500     The <i>-trace</i> parameter for the smpirun script runs the
501 simulation with --cfg=tracing:yes and --cfg=tracing/smpi:yes. Check the
502 smpirun's <i>-help</i> parameter for additional tracing options.
503
504 Sometimes you might want to put additional information on the trace to
505 correctly identify them later, or to provide data that can be used to
506 reproduce an experiment. You have two ways to do that:
507
508 - Add a string on top of the trace file as comment:
509 \verbatim
510 --cfg=tracing/comment:my_simulation_identifier
511 \endverbatim
512
513 - Add the contents of a textual file on top of the trace file as comment:
514 \verbatim
515 --cfg=tracing/comment_file:my_file_with_additional_information.txt
516 \endverbatim
517
518 Please, use these two parameters (for comments) to make reproducible
519 simulations. For additional details about this and all tracing
520 options, check See the \ref tracing_tracing_options.
521
522 \section options_smpi Configuring SMPI
523
524 The SMPI interface provides several specific configuration items.
525 These are uneasy to see since the code is usually launched through the
526 \c smiprun script directly.
527
528 \subsection options_smpi_bench Automatic benchmarking of SMPI code
529
530 In SMPI, the sequential code is automatically benchmarked, and these
531 computations are automatically reported to the simulator. That is to
532 say that if you have a large computation between a \c MPI_Recv() and a
533 \c MPI_Send(), SMPI will automatically benchmark the duration of this
534 code, and create an execution task within the simulator to take this
535 into account. For that, the actual duration is measured on the host
536 machine and then scaled to the power of the corresponding simulated
537 machine. The variable \b smpi/running_power allows to specify the
538 computational power of the host machine (in flop/s) to use when
539 scaling the execution times. It defaults to 20000, but you really want
540 to update it to get accurate simulation results.
541
542 When the code is constituted of numerous consecutive MPI calls, the
543 previous mechanism feeds the simulation kernel with numerous tiny
544 computations. The \b smpi/cpu_threshold item becomes handy when this
545 impacts badly the simulation performance. It specify a threshold (in
546 second) under which the execution chunks are not reported to the
547 simulation kernel (default value: 1e-6). Please note that in some
548 circonstances, this optimization can hinder the simulation accuracy.
549
550  In some cases, however, one may wish to disable simulation of
551 application computation. This is the case when SMPI is used not to
552 simulate an MPI applications, but instead an MPI code that performs
553 "live replay" of another MPI app (e.g., ScalaTrace's replay tool,
554 various on-line simulators that run an app at scale). In this case the
555 computation of the replay/simulation logic should not be simulated by
556 SMPI. Instead, the replay tool or on-line simulator will issue
557 "computation events", which correspond to the actual MPI simulation
558 being replayed/simulated. At the moment, these computation events can
559 be simulated using SMPI by calling internal smpi_execute*() functions.
560
561 To disable the benchmarking/simulation of computation in the simulated
562 application, the variable \b
563 smpi/simulation_computation should be set to no
564
565 \subsection options_smpi_timing Reporting simulation time
566
567 Most of the time, you run MPI code through SMPI to compute the time it
568 would take to run it on a platform that you don't have. But since the
569 code is run through the \c smpirun script, you don't have any control
570 on the launcher code, making difficult to report the simulated time
571 when the simulation ends. If you set the \b smpi/display_timing item
572 to 1, \c smpirun will display this information when the simulation ends. \verbatim
573 Simulation time: 1e3 seconds.
574 \endverbatim
575
576 \subsection options_smpi_global Automatic privatization of global variables
577
578 MPI executables are meant to be executed in separated processes, but SMPI is 
579 executed in only one process. Global variables from executables will be placed 
580 in the same memory zone and shared between processes, causing hard to find bugs.
581 To avoid this, several options are possible :
582   - Manual edition of the code, for example to add __thread keyword before data
583   declaration, which allows the resulting code to work with SMPI, but only 
584   if the thread factory (see \ref options_virt_factory) is used, as global 
585   variables are then placed in the TLS (thread local storage) segment. 
586   - Source-to-source transformation, to add a level of indirection 
587   to the global variables. SMPI does this for F77 codes compiled with smpiff, 
588   and used to provide coccinelle scripts for C codes, which are not functional anymore.
589   - Compilation pass, to have the compiler automatically put the data in 
590   an adapted zone. 
591   - Runtime automatic switching of the data segments. SMPI stores a copy of 
592   each global data segment for each process, and at each context switch replaces 
593   the actual data with its copy from the right process. This mechanism uses mmap,
594   and is for now limited to systems supporting this functionnality (all Linux 
595   and some BSD should be compatible).
596   Another limitation is that SMPI only accounts for global variables defined in
597   the executable. If the processes use external global variables from dynamic 
598   libraries, they won't be switched correctly. To avoid this, using static 
599   linking is advised (but not with the simgrid library, to avoid replicating 
600   its own global variables). 
601
602   To use this runtime automatic switching, the variable \b smpi/privatize_global_variables
603   should be set to yes
604
605
606
607 \subsection options_model_smpi_detached Simulating MPI detached send
608
609 This threshold specifies the size in bytes under which the send will return 
610 immediately. This is different from the threshold detailed in  \ref options_model_network_asyncsend
611 because the message is not effectively sent when the send is posted. SMPI still waits for the
612 correspondant receive to be posted to perform the communication operation. This threshold can be set 
613 by changing the \b smpi/send_is_detached item. The default value is 65536.
614
615 \subsection options_model_smpi_collectives Simulating MPI collective algorithms
616
617 SMPI implements more than 100 different algorithms for MPI collective communication, to accurately 
618 simulate the behavior of most of the existing MPI libraries. The \b smpi/coll_selector item can be used
619  to use the decision logic of either OpenMPI or MPICH libraries (values: ompi or mpich, by default SMPI
620 uses naive version of collective operations). Each collective operation can be manually selected with a 
621 \b smpi/collective_name:algo_name. Available algorithms are listed in \ref SMPI_collective_algorithms .
622
623
624 \section options_generic Configuring other aspects of SimGrid
625
626 \subsection options_generic_path XML file inclusion path
627
628 It is possible to specify a list of directories to search into for the
629 \<include\> tag in XML files by using the \b path configuration
630 item. To add several directory to the path, set the configuration
631 item several times, as in \verbatim
632 --cfg=path:toto --cfg=path:tutu
633 \endverbatim
634
635 \subsection options_generic_exit Behavior on Ctrl-C
636
637 By default, when Ctrl-C is pressed, the status of all existing
638 simulated processes is displayed before exiting the simulation. This is very useful to debug your
639 code, but it can reveal troublesome in some cases (such as when the
640 amount of processes becomes really big). This behavior is disabled
641 when \b verbose-exit is set to 0 (it is to 1 by default).
642
643
644 \section options_log Logging Configuration
645
646 It can be done by using XBT. Go to \ref XBT_log for more details.
647
648 \section options_perf Performance optimizations
649
650 \subsection options_perf_context Context factory
651
652 In order to achieve higher performance, you might want to use the raw
653 context factory which avoids any system call when switching between
654 tasks. If it is not possible you might use ucontext instead.
655
656 \subsection options_perf_guard_size Disabling stack guard pages
657
658 A stack guard page is usually used which prevents the stack from
659 overflowing on other parts of the memory. However this might have a
660 performance impact if a huge number of processes is created.  The
661 option \b contexts:guard_size is the number of stack guard pages
662 used. By setting it to 0, no guard pages will be used: in this case,
663 you should avoid using small stacks (\b stack_size) as the stack will
664 silently overflow on other parts of the memory.
665
666 \section options_index Index of all existing configuration items
667
668 - \c contexts/factory: \ref options_virt_factory
669 - \c contexts/nthreads: \ref options_virt_parallel
670 - \c contexts/parallel_threshold: \ref options_virt_parallel
671 - \c contexts/stack_size: \ref options_virt_stacksize
672 - \c contexts/synchro: \ref options_virt_parallel
673 - \c contexts/guard_size: \ref options_virt_parallel
674
675 - \c cpu/maxmin_selective_update: \ref options_model_optim
676 - \c cpu/model: \ref options_model_select
677 - \c cpu/optim: \ref options_model_optim
678
679 - \c gtnets/jitter: \ref options_pls
680 - \c gtnets/jitter_seed: \ref options_pls
681
682 - \c maxmin/precision: \ref options_model_precision
683
684 - \c model-check: \ref options_modelchecking
685 - \c model-check/property: \ref options_modelchecking_liveness
686 - \c model-check/checkpoint: \ref options_modelchecking_steps
687 - \c model-check/reduce: \ref options_modelchecking_reduction
688
689 - \c network/bandwidth_factor: \ref options_model_network_coefs
690 - \c network/coordinates: \ref options_model_network_coord
691 - \c network/crosstraffic: \ref options_model_network_crosstraffic
692 - \c network/latency_factor: \ref options_model_network_coefs
693 - \c network/maxmin_selective_update: \ref options_model_optim
694 - \c network/model: \ref options_model_select
695 - \c network/optim: \ref options_model_optim
696 - \c network/sender_gap: \ref options_model_network_sendergap
697 - \c network/TCP_gamma: \ref options_model_network_gamma
698 - \c network/weight_S: \ref options_model_network_coefs
699
700 - \c ns3/TcpModel: \ref options_pls
701
702 - \c surf/nthreads: \ref options_model_nthreads
703
704 - \c smpi/simulation_computation: \ref options_smpi_bench
705 - \c smpi/running_power: \ref options_smpi_bench
706 - \c smpi/display_timing: \ref options_smpi_timing
707 - \c smpi/cpu_threshold: \ref options_smpi_bench
708 - \c smpi/async_small_thres: \ref options_model_network_asyncsend
709 - \c smpi/send_is_detached: \ref options_model_smpi_detached
710 - \c smpi/coll_selector: \ref options_model_smpi_collectives
711 - \c smpi/privatize_global_variables: \ref options_smpi_global
712
713 - \c path: \ref options_generic_path
714 - \c verbose-exit: \ref options_generic_exit
715
716 - \c workstation/model: \ref options_model_select
717
718 */