Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove unused option: network/sender-gap.
[simgrid.git] / doc / doxygen / options.doc
1 /*! \page options Configure SimGrid
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 \tableofcontents
13
14 \section options_using Passing configuration options to the simulators
15
16 There is several way to pass configuration options to the simulators.
17 The most common way is to use the \c --cfg command line argument. For
18 example, to set the item \c Item to the value \c Value, simply
19 type the following: \verbatim
20 my_simulator --cfg=Item:Value (other arguments)
21 \endverbatim
22
23 Several \c `--cfg` command line arguments can naturally be used. If you
24 need to include spaces in the argument, don't forget to quote the
25 argument. You can even escape the included quotes (write \' for ' if
26 you have your argument between ').
27
28 Another solution is to use the \c \<config\> tag in the platform file. The
29 only restriction is that this tag must occure before the first
30 platform element (be it \c \<AS\>, \c \<cluster\>, \c \<peer\> or whatever).
31 The \c \<config\> tag takes an \c id attribute, but it is currently
32 ignored so you don't really need to pass it. The important par is that
33 within that tag, you can pass one or several \c \<prop\> tags to specify
34 the configuration to use. For example, setting \c Item to \c Value
35 can be done by adding the following to the beginning of your platform
36 file:
37 \verbatim
38 <config>
39   <prop id="Item" value="Value"/>
40 </config>
41 \endverbatim
42
43 A last solution is to pass your configuration directly using the C
44 interface. If you happen to use the MSG interface, this is very easy
45 with the simgrid::s4u::Engine::setConfig() or MSG_config() functions. If you do not use MSG, that's a bit
46 more complex, as you have to mess with the internal configuration set
47 directly as follows. Check the \ref XBT_config "relevant page" for
48 details on all the functions you can use in this context, \c
49 _sg_cfg_set being the only configuration set currently used in
50 SimGrid.
51
52 @code
53 #include <xbt/config.h>
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("Item:Value");
60
61      // Rest of your code
62 }
63 @endcode
64
65 \section options_index Index of all existing configuration options
66
67 \note
68   The full list can be retrieved by passing "--help" and
69      "--help-cfg" to an executable that uses SimGrid.
70
71 - \c clean-atexit: \ref options_generic_clean_atexit
72
73 - \c contexts/factory: \ref options_virt_factory
74 - \c contexts/guard-size: \ref options_virt_guard_size
75 - \c contexts/nthreads: \ref options_virt_parallel
76 - \c contexts/parallel-threshold: \ref options_virt_parallel
77 - \c contexts/stack-size: \ref options_virt_stacksize
78 - \c contexts/synchro: \ref options_virt_parallel
79
80 - \c cpu/maxmin-selective-update: \ref options_model_optim
81 - \c cpu/model: \ref options_model_select
82 - \c cpu/optim: \ref options_model_optim
83
84 - \c exception/cutpath: \ref options_exception_cutpath
85
86 - \c host/model: \ref options_model_select
87
88 - \c maxmin/precision: \ref options_model_precision
89 - \c maxmin/concurrency-limit: \ref options_concurrency_limit
90
91 - \c msg/debug-multiple-use: \ref options_msg_debug_multiple_use
92
93 - \c model-check: \ref options_modelchecking
94 - \c model-check/checkpoint: \ref options_modelchecking_steps
95 - \c model-check/communications-determinism: \ref options_modelchecking_comm_determinism
96 - \c model-check/dot-output: \ref options_modelchecking_dot_output
97 - \c model-check/hash: \ref options_modelchecking_hash
98 - \c model-check/property: \ref options_modelchecking_liveness
99 - \c model-check/max-depth: \ref options_modelchecking_max_depth
100 - \c model-check/record: \ref options_modelchecking_recordreplay
101 - \c model-check/reduction: \ref options_modelchecking_reduction
102 - \c model-check/replay: \ref options_modelchecking_recordreplay
103 - \c model-check/send-determinism: \ref options_modelchecking_comm_determinism
104 - \c model-check/sparse-checkpoint: \ref options_modelchecking_sparse_checkpoint
105 - \c model-check/termination: \ref options_modelchecking_termination
106 - \c model-check/timeout: \ref options_modelchecking_timeout
107 - \c model-check/visited: \ref options_modelchecking_visited
108
109 - \c network/bandwidth-factor: \ref options_model_network_coefs
110 - \c network/crosstraffic: \ref options_model_network_crosstraffic
111 - \c network/latency-factor: \ref options_model_network_coefs
112 - \c network/maxmin-selective-update: \ref options_model_optim
113 - \c network/model: \ref options_model_select
114 - \c network/optim: \ref options_model_optim
115 - \c network/TCP-gamma: \ref options_model_network_gamma
116 - \c network/weight-S: \ref options_model_network_coefs
117
118 - \c ns3/TcpModel: \ref options_pls
119 - \c path: \ref options_generic_path
120 - \c plugin: \ref options_generic_plugin
121
122 - \c storage/max_file_descriptors: \ref option_model_storage_maxfd
123
124 - \c surf/precision: \ref options_model_precision
125
126 - \c <b>For collective operations of SMPI, please refer to Section \ref options_index_smpi_coll</b>
127 - \c smpi/async-small-thresh: \ref options_model_network_asyncsend
128 - \c smpi/bw-factor: \ref options_model_smpi_bw_factor
129 - \c smpi/coll-selector: \ref options_model_smpi_collectives
130 - \c smpi/comp-adjustment-file: \ref options_model_smpi_adj_file
131 - \c smpi/cpu-threshold: \ref options_smpi_bench
132 - \c smpi/display-timing: \ref options_smpi_timing
133 - \c smpi/grow-injected-times: \ref options_model_smpi_test
134 - \c smpi/host-speed: \ref options_smpi_bench
135 - \c smpi/IB-penalty-factors: \ref options_model_network_coefs
136 - \c smpi/iprobe: \ref options_model_smpi_iprobe
137 - \c smpi/iprobe-cpu-usage: \ref options_model_smpi_iprobe_cpu_usage
138 - \c smpi/init: \ref options_model_smpi_init
139 - \c smpi/keep-temps: \ref options_smpi_temps
140 - \c smpi/lat-factor: \ref options_model_smpi_lat_factor
141 - \c smpi/ois: \ref options_model_smpi_ois
142 - \c smpi/or: \ref options_model_smpi_or
143 - \c smpi/os: \ref options_model_smpi_os
144 - \c smpi/papi-events: \ref options_smpi_papi_events
145 - \c smpi/privatization: \ref options_smpi_privatization
146 - \c smpi/send-is-detached-thresh: \ref options_model_smpi_detached
147 - \c smpi/shared-malloc: \ref options_model_smpi_shared_malloc
148 - \c smpi/shared-malloc-hugepage: \ref options_model_smpi_shared_malloc
149 - \c smpi/simulate-computation: \ref options_smpi_bench
150 - \c smpi/test: \ref options_model_smpi_test
151 - \c smpi/wtime: \ref options_model_smpi_wtime
152
153 - \c <b>Tracing configuration options can be found in Section \ref tracing_tracing_options</b>.
154
155 - \c storage/model: \ref options_storage_model
156 - \c verbose-exit: \ref options_generic_exit
157
158 - \c vm/model: \ref options_vm_model
159
160 \subsection options_index_smpi_coll Index of SMPI collective algorithms options
161
162 TODO: All available collective algorithms will be made available via the ``smpirun --help-coll`` command.
163
164 \section options_model Configuring the platform models
165
166 \anchor options_storage_model
167 \anchor options_vm_model
168 \subsection options_model_select Selecting the platform models
169
170 SimGrid comes with several network, CPU and storage models built in, and you
171 can change the used model at runtime by changing the passed
172 configuration. The three main configuration items are given below.
173 For each of these items, passing the special \c help value gives
174 you a short description of all possible values. Also, \c --help-models
175 should provide information about all models for all existing resources.
176    - \b network/model: specify the used network model
177    - \b cpu/model: specify the used CPU model
178    - \b host/model: specify the used host model
179    - \b storage/model: specify the used storage model (there is currently only one such model - this option is hence only useful for future releases)
180    - \b vm/model: specify the model for virtual machines (there is currently only one such model - this option is hence only useful for future releases)
181
182 As of writing, the following network models are accepted. Over
183 the time new models can be added, and some experimental models can be
184 removed; check the values on your simulators for an uptodate
185 information. Note that the CM02 model is described in the research report
186 <a href="ftp://ftp.ens-lyon.fr/pub/LIP/Rapports/RR/RR2002/RR2002-40.ps.gz">A
187 Network Model for Simulation of Grid Application</a> while LV08 is
188 described in
189 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>.
190
191   - \b LV08 (default one): Realistic network analytic model
192     (slow-start modeled by multiplying latency by 10.4, bandwidth by
193     .92; bottleneck sharing uses a payload of S=8775 for evaluating RTT)
194   - \anchor options_model_select_network_constant \b Constant: Simplistic network model where all communication
195     take a constant time (one second). This model provides the lowest
196     realism, but is (marginally) faster.
197   - \b SMPI: Realistic network model specifically tailored for HPC
198     settings (accurate modeling of slow start with correction factors on
199     three intervals: < 1KiB, < 64 KiB, >= 64 KiB). See also \ref
200     options_model_network_coefs "this section" for more info.
201   - \b IB: Realistic network model specifically tailored for HPC
202     settings with InfiniBand networks (accurate modeling contention
203     behavior, based on the model explained in
204     http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf).
205     See also \ref options_model_network_coefs "this section" for more info.
206   - \b CM02: Legacy network analytic model (Very similar to LV08, but
207     without corrective factors. The timings of small messages are thus
208     poorly modeled)
209   - \b Reno: Model from Steven H. Low using lagrange_solve instead of
210     lmm_solve (experts only; check the code for more info).
211   - \b Reno2: Model from Steven H. Low using lagrange_solve instead of
212     lmm_solve (experts only; check the code for more info).
213   - \b Vegas: Model from Steven H. Low using lagrange_solve instead of
214     lmm_solve (experts only; check the code for more info).
215
216 If you compiled SimGrid accordingly, you can use packet-level network
217 simulators as network models (see \ref pls_ns3). In that case, you have
218 two extra models, described below, and some 
219 \ref options_pls "specific additional configuration flags".
220   - \b NS3: Network pseudo-model using the NS3 tcp model
221
222 Concerning the CPU, we have only one model for now:
223   - \b Cas01: Simplistic CPU model (time=size/power)
224
225 The host concept is the aggregation of a CPU with a network
226 card. Three models exists, but actually, only 2 of them are
227 interesting. The "compound" one is simply due to the way our internal
228 code is organized, and can easily be ignored. So at the end, you have
229 two host models: The default one allows to aggregate an
230 existing CPU model with an existing network model, but does not allow
231 parallel tasks because these beasts need some collaboration between
232 the network and CPU model. That is why, ptask_07 is used by default
233 when using SimDag.
234   - \b default: Default host model. Currently, CPU:Cas01 and
235     network:LV08 (with cross traffic enabled)
236   - \b compound: Host model that is automatically chosen if
237     you change the network and CPU models
238   - \b ptask_L07: Host model somehow similar to Cas01+CM02 but
239     allowing "parallel tasks", that are intended to model the moldable
240     tasks of the grid scheduling literature.
241
242 \subsection options_generic_plugin Plugins
243
244 SimGrid supports the use of plugins; currently, no known plugins
245 can be activated but there are use-cases where you may want to write
246 your own plugin (for instance, for logging).
247
248 Plugins can for instance define own classes that inherit from
249 existing classes (for instance, a class "CpuEnergy" inherits from
250 "Cpu" to assess energy consumption).
251
252 The plugin connects to the code by registering callbacks using
253 ``signal.connect(callback)`` (see file ``src/surf/plugins/energy.cpp`` for
254 details).
255
256 \verbatim
257     --cfg=plugin:Energy
258 \endverbatim
259
260 \note
261     This option is case-sensitive: Energy and energy are not the same!
262
263 \subsection options_model_optim Optimization level of the platform models
264
265 The network and CPU models that are based on lmm_solve (that
266 is, all our analytical models) accept specific optimization
267 configurations.
268   - items \b network/optim and \b cpu/optim (both default to 'Lazy'):
269     - \b Lazy: Lazy action management (partial invalidation in lmm +
270       heap in action remaining).
271     - \b TI: Trace integration. Highly optimized mode when using
272       availability traces (only available for the Cas01 CPU model for
273       now).
274     - \b Full: Full update of remaining and variables. Slow but may be
275       useful when debugging.
276   - items \b network/maxmin-selective-update and
277     \b cpu/maxmin-selective-update: configure whether the underlying
278     should be lazily updated or not. It should have no impact on the
279     computed timings, but should speed up the computation.
280
281 It is still possible to disable the \c maxmin-selective-update feature
282 because it can reveal counter-productive in very specific scenarios
283 where the interaction level is high. In particular, if all your
284 communication share a given backbone link, you should disable it:
285 without \c maxmin-selective-update, every communications are updated
286 at each step through a simple loop over them. With that feature
287 enabled, every communications will still get updated in this case
288 (because of the dependency induced by the backbone), but through a
289 complicated pattern aiming at following the actual dependencies.
290
291 \subsection options_model_precision Numerical precision of the platform models
292
293 The analytical models handle a lot of floating point values. It is
294 possible to change the epsilon used to update and compare them through
295 the \b maxmin/precision item (default value: 0.00001). Changing it
296 may speedup the simulation by discarding very small actions, at the
297 price of a reduced numerical precision.
298
299 \subsection options_concurrency_limit Concurrency limit
300
301 The maximum number of variables per resource can be tuned through
302 the \b maxmin/concurrency-limit item. The default value is -1, meaning that
303 there is no such limitation. You can have as many simultaneous actions per
304 resources as you want. If your simulation presents a very high level of
305 concurrency, it may help to use e.g. 100 as a value here. It means that at
306 most 100 actions can consume a resource at a given time. The extraneous actions
307 are queued and wait until the amount of concurrency of the considered resource
308 lowers under the given boundary.
309
310 Such limitations help both to the simulation speed and simulation accuracy
311 on highly constrained scenarios, but the simulation speed suffers of this
312 setting on regular (less constrained) scenarios so it is off by default.
313
314 \subsection options_model_network Configuring the Network model
315
316 \subsubsection options_model_network_gamma Maximal TCP window size
317
318 The analytical models need to know the maximal TCP window size to take
319 the TCP congestion mechanism into account. This is set to 20000 by
320 default, but can be changed using the \b network/TCP-gamma item.
321
322 On linux, this value can be retrieved using the following
323 commands. Both give a set of values, and you should use the last one,
324 which is the maximal size.\verbatim
325 cat /proc/sys/net/ipv4/tcp_rmem # gives the sender window
326 cat /proc/sys/net/ipv4/tcp_wmem # gives the receiver window
327 \endverbatim
328
329 \subsubsection options_model_network_coefs Correcting important network parameters
330
331 SimGrid can take network irregularities such as a slow startup or
332 changing behavior depending on the message size into account.
333 You should not change these values unless you really know what you're doing.
334
335 The corresponding values were computed through data fitting one the
336 timings of packet-level simulators.
337
338 See
339 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>
340 for more information about these parameters.
341
342 If you are using the SMPI model, these correction coefficients are
343 themselves corrected by constant values depending on the size of the
344 exchange. Again, only hardcore experts should bother about this fact.
345
346 InfiniBand network behavior can be modeled through 3 parameters, as explained in
347 <a href="http://mescal.imag.fr/membres/jean-marc.vincent/index.html/PhD/Vienne.pdf">this PhD thesis</a>.
348 These factors can be changed through the following option:
349
350 \verbatim
351 smpi/IB-penalty-factors:"βe;βs;γs"
352 \endverbatim
353
354 By default SMPI uses factors computed on the Stampede Supercomputer at TACC, with optimal
355 deployment of processes on nodes.
356
357 \subsubsection options_model_network_crosstraffic Simulating cross-traffic
358
359 As of SimGrid v3.7, cross-traffic effects can be taken into account in
360 analytical simulations. It means that ongoing and incoming
361 communication flows are treated independently. In addition, the LV08
362 model adds 0.05 of usage on the opposite direction for each new
363 created flow. This can be useful to simulate some important TCP
364 phenomena such as ack compression.
365
366 For that to work, your platform must have two links for each
367 pair of interconnected hosts. An example of usable platform is
368 available in <tt>examples/platforms/crosstraffic.xml</tt>.
369
370 This is activated through the \b network/crosstraffic item, that
371 can be set to 0 (disable this feature) or 1 (enable it).
372
373 Note that with the default host model this option is activated by default.
374
375 \subsubsection options_model_network_asyncsend Simulating asyncronous send
376
377 (this configuration item is experimental and may change or disapear)
378
379 It is possible to specify that messages below a certain size will be sent
380 as soon as the call to MPI_Send is issued, without waiting for the
381 correspondant receive. This threshold can be configured through the
382 \b smpi/async-small-thresh item. The default value is 0. This behavior can also be
383 manually set for MSG mailboxes, by setting the receiving mode of the mailbox
384 with a call to \ref MSG_mailbox_set_async . For MSG, all messages sent to this
385 mailbox will have this behavior, so consider using two mailboxes if needed.
386
387 This value needs to be smaller than or equals to the threshold set at
388 \ref options_model_smpi_detached , because asynchronous messages are
389 meant to be detached as well.
390
391 \subsubsection options_pls Configuring packet-level pseudo-models
392
393 When using the packet-level pseudo-models, several specific
394 configuration flags are provided to configure the associated tools.
395 There is by far not enough such SimGrid flags to cover every aspects
396 of the associated tools, since we only added the items that we
397 needed ourselves. Feel free to request more items (or even better:
398 provide patches adding more items).
399
400 When using NS3, the only existing item is \b ns3/TcpModel,
401 corresponding to the ns3::TcpL4Protocol::SocketType configuration item
402 in NS3. The only valid values (enforced on the SimGrid side) are
403 'NewReno' or 'Reno' or 'Tahoe'.
404
405 \subsection options_model_storage Configuring the Storage model
406
407 \subsubsection option_model_storage_maxfd Maximum amount of file descriptors per host
408
409 Each host maintains a fixed-size array of its file descriptors. You
410 can change its size (1024 by default) through the \b
411 storage/max_file_descriptors item to either enlarge it if your
412 application requires it or to reduce it to save memory space.
413
414 \section options_modelchecking Configuring the Model-Checking
415
416 To enable the SimGrid model-checking support the program should
417 be executed using the simgrid-mc wrapper:
418 \verbatim
419 simgrid-mc ./my_program
420 \endverbatim
421
422 Safety properties are expressed as assertions using the function
423 \verbatim
424 void MC_assert(int prop);
425 \endverbatim
426
427 \subsection options_modelchecking_liveness Specifying a liveness property
428
429 If you want to specify liveness properties (beware, that's
430 experimental), you have to pass them on the command line, specifying
431 the name of the file containing the property, as formatted by the
432 ltl2ba program.
433
434 \verbatim
435 --cfg=model-check/property:<filename>
436 \endverbatim
437
438 \subsection options_modelchecking_steps Going for stateful verification
439
440 By default, the system is backtracked to its initial state to explore
441 another path instead of backtracking to the exact step before the fork
442 that we want to explore (this is called stateless verification). This
443 is done this way because saving intermediate states can rapidly
444 exhaust the available memory. If you want, you can change the value of
445 the <tt>model-check/checkpoint</tt> variable. For example, the
446 following configuration will ask to take a checkpoint every step.
447 Beware, this will certainly explode your memory. Larger values are
448 probably better, make sure to experiment a bit to find the right
449 setting for your specific system.
450
451 \verbatim
452 --cfg=model-check/checkpoint:1
453 \endverbatim
454
455 \subsection options_modelchecking_reduction Specifying the kind of reduction
456
457 The main issue when using the model-checking is the state space
458 explosion. To counter that problem, several exploration reduction
459 techniques can be used. There is unfortunately no silver bullet here,
460 and the most efficient reduction techniques cannot be applied to any
461 properties. In particular, the DPOR method cannot be applied on
462 liveness properties since it may break some cycles in the exploration
463 that are important to the property validity.
464
465 \verbatim
466 --cfg=model-check/reduction:<technique>
467 \endverbatim
468
469 For now, this configuration variable can take 2 values:
470  * none: Do not apply any kind of reduction (mandatory for now for
471    liveness properties)
472  * dpor: Apply Dynamic Partial Ordering Reduction. Only valid if you
473    verify local safety properties (default value for safety checks).
474
475 \subsection options_modelchecking_visited model-check/visited, Cycle detection
476
477 In order to detect cycles, the model-checker needs to check if a new explored
478 state is in fact the same state than a previous one. For that,
479 the model-checker can take a snapshot of each visited state: this snapshot is
480 then used to compare it with subsequent states in the exploration graph.
481
482 The \b model-check/visited option is the maximum number of states which are stored in
483 memory. If the maximum number of snapshotted state is reached, some states will
484 be removed from the memory and some cycles might be missed. Small
485 values can lead to incorrect verifications, but large value can
486 exhaust your memory, so choose carefully.
487
488 By default, no state is snapshotted and cycles cannot be detected.
489
490 \subsection options_modelchecking_termination model-check/termination, Non termination detection
491
492 The \b model-check/termination configuration item can be used to report if a
493 non-termination execution path has been found. This is a path with a cycle
494 which means that the program might never terminate.
495
496 This only works in safety mode.
497
498 This options is disabled by default.
499
500 \subsection options_modelchecking_dot_output model-check/dot-output, Dot output
501
502 If set, the \b model-check/dot-output configuration item is the name of a file
503 in which to write a dot file of the path leading the found property (safety or
504 liveness violation) as well as the cycle for liveness properties. This dot file
505 can then fed to the graphviz dot tool to generate an corresponding graphical
506 representation.
507
508 \subsection options_modelchecking_max_depth model-check/max-depth, Depth limit
509
510 The \b model-checker/max-depth can set the maximum depth of the exploration
511 graph of the model-checker. If this limit is reached, a logging message is
512 sent and the results might not be exact.
513
514 By default, there is not depth limit.
515
516 \subsection options_modelchecking_timeout Handling of timeout
517
518 By default, the model-checker does not handle timeout conditions: the `wait`
519 operations never time out. With the \b model-check/timeout configuration item
520 set to \b yes, the model-checker will explore timeouts of `wait` operations.
521
522 \subsection options_modelchecking_comm_determinism Communication determinism
523
524 The \b model-check/communications-determinism and
525 \b model-check/send-determinism items can be used to select the communication
526 determinism mode of the model-checker which checks determinism properties of
527 the communications of an application.
528
529 \subsection options_modelchecking_sparse_checkpoint Per page checkpoints
530
531 When the model-checker is configured to take a snapshot of each explored state
532 (with the \b model-checker/visited item), the memory consumption can rapidly
533 reach GiB ou Tib of memory. However, for many workloads, the memory does not
534 change much between different snapshots and taking a complete copy of each
535 snapshot is a waste of memory.
536
537 The \b model-check/sparse-checkpoint option item can be set to \b yes in order
538 to avoid making a complete copy of each snapshot: instead, each snapshot will be
539 decomposed in blocks which will be stored separately.
540 If multiple snapshots share the same block (or if the same block
541 is used in the same snapshot), the same copy of the block will be shared leading
542 to a reduction of the memory footprint.
543
544 For many applications, this option considerably reduces the memory consumption.
545 In somes cases, the model-checker might be slightly slower because of the time
546 taken to manage the metadata about the blocks. In other cases however, this
547 snapshotting strategy will be much faster by reducing the cache consumption.
548 When the memory consumption is important, by avoiding to hit the swap or
549 reducing the swap usage, this option might be much faster than the basic
550 snapshotting strategy.
551
552 This option is currently disabled by default.
553
554 \subsection options_mc_perf Performance considerations for the model checker
555
556 The size of the stacks can have a huge impact on the memory
557 consumption when using model-checking. By default, each snapshot will
558 save a copy of the whole stacks and not only of the part which is
559 really meaningful: you should expect the contribution of the memory
560 consumption of the snapshots to be \f$ \mbox{number of processes}
561 \times \mbox{stack size} \times \mbox{number of states} \f$.
562
563 The \b model-check/sparse-checkpoint can be used to reduce the memory
564 consumption by trying to share memory between the different snapshots.
565
566 When compiled against the model checker, the stacks are not
567 protected with guards: if the stack size is too small for your
568 application, the stack will silently overflow on other parts of the
569 memory (see \ref options_virt_guard_size).
570
571 \subsection options_modelchecking_hash Hashing of the state (experimental)
572
573 Usually most of the time of the model-checker is spent comparing states. This
574 process is complicated and consumes a lot of bandwidth and cache.
575 In order to speedup the state comparison, the experimental \b model-checker/hash
576 configuration item enables the computation of a hash summarizing as much
577 information of the state as possible into a single value. This hash can be used
578 to avoid most of the comparisons: the costly comparison is then only used when
579 the hashes are identical.
580
581 Currently most of the state is not included in the hash because the
582 implementation was found to be buggy and this options is not as useful as
583 it could be. For this reason, it is currently disabled by default.
584
585 \subsection options_modelchecking_recordreplay Record/replay (experimental)
586
587 As the model-checker keeps jumping at different places in the execution graph,
588 it is difficult to understand what happens when trying to debug an application
589 under the model-checker. Event the output of the program is difficult to
590 interpret. Moreover, the model-checker does not behave nicely with advanced
591 debugging tools such as valgrind. For those reason, to identify a trajectory
592 in the execution graph with the model-checker and replay this trajcetory and
593 without the model-checker black-magic but with more standard tools
594 (such as a debugger, valgrind, etc.). For this reason, Simgrid implements an
595 experimental record/replay functionnality in order to record a trajectory with
596 the model-checker and replay it without the model-checker.
597
598 When the model-checker finds an interesting path in the application execution
599 graph (where a safety or liveness property is violated), it can generate an
600 identifier for this path. In order to enable this behavious the
601 \b model-check/record must be set to \b yes. By default, this behaviour is not
602 enabled.
603
604 This is an example of output:
605
606 <pre>
607 [  0.000000] (0:@) Check a safety property
608 [  0.000000] (0:@) **************************
609 [  0.000000] (0:@) *** PROPERTY NOT VALID ***
610 [  0.000000] (0:@) **************************
611 [  0.000000] (0:@) Counter-example execution trace:
612 [  0.000000] (0:@) Path = 1/3;1/4
613 [  0.000000] (0:@) [(1)Tremblay (app)] MC_RANDOM(3)
614 [  0.000000] (0:@) [(1)Tremblay (app)] MC_RANDOM(4)
615 [  0.000000] (0:@) Expanded states = 27
616 [  0.000000] (0:@) Visited states = 68
617 [  0.000000] (0:@) Executed transitions = 46
618 </pre>
619
620 This path can then be replayed outside of the model-checker (and even in
621 non-MC build of simgrid) by setting the \b model-check/replay item to the given
622 path. The other options should be the same (but the model-checker should
623 be disabled).
624
625 The format and meaning of the path may change between different releases so
626 the same release of Simgrid should be used for the record phase and the replay
627 phase.
628
629 \section options_virt Configuring the User Process Virtualization
630
631 \subsection options_virt_factory Selecting the virtualization factory
632
633 In SimGrid, the user code is virtualized in a specific mechanism
634 that allows the simulation kernel to control its execution: when a user
635 process requires a blocking action (such as sending a message), it is
636 interrupted, and only gets released when the simulated clock reaches
637 the point where the blocking operation is done. This is explained
638 graphically in the [relevant tutorial, available online](http://simgrid.gforge.inria.fr/tutorials/simgrid-simix-101.pdf).
639
640 In SimGrid, the containers in which user processes are virtualized are
641 called contexts. Several context factory are provided, and you can
642 select the one you want to use with the \b contexts/factory
643 configuration item. Some of the following may not exist on your
644 machine because of portability issues. In any case, the default one
645 should be the most effcient one (please report bugs if the
646 auto-detection fails for you). They are approximately sorted here from
647 the slowest to the most efficient:
648
649  - \b thread: very slow factory using full featured threads (either
650    pthreads or windows native threads). They are slow but very
651    standard. Some debuggers or profilers only work with this factory.
652  - \b java: Java applications are virtualized onto java threads (that
653    are regular pthreads registered to the JVM)
654  - \b ucontext: fast factory using System V contexts (Linux and FreeBSD only)
655  - \b boost: This uses the [context implementation](http://www.boost.org/doc/libs/1_59_0/libs/context/doc/html/index.html)
656    of the boost library for a performance that is comparable to our
657    raw implementation.\nInstall the relevant library (e.g. with the
658    libboost-contexts-dev package on Debian/Ubuntu) and recompile
659    SimGrid. Note that our implementation is not compatible with recent
660    implementations of the library, and it will be hard to fix this since
661    the library's author decided to hide an API that we were using.
662  - \b raw: amazingly fast factory using a context switching mechanism
663    of our own, directly implemented in assembly (only available for x86
664    and amd64 platforms for now) and without any unneeded system call.
665
666 The main reason to change this setting is when the debugging tools get
667 fooled by the optimized context factories. Threads are the most
668 debugging-friendly contextes, as they allow to set breakpoints
669 anywhere with gdb and visualize backtraces for all processes, in order
670 to debug concurrency issues. Valgrind is also more comfortable with
671 threads, but it should be usable with all factories (but the callgrind
672 tool that really don't like raw and ucontext factories).
673
674 \subsection options_virt_stacksize Adapting the used stack size
675
676 Each virtualized used process is executed using a specific system
677 stack. The size of this stack has a huge impact on the simulation
678 scalability, but its default value is rather large. This is because
679 the error messages that you get when the stack size is too small are
680 rather disturbing: this leads to stack overflow (overwriting other
681 stacks), leading to segfaults with corrupted stack traces.
682
683 If you want to push the scalability limits of your code, you might
684 want to reduce the \b contexts/stack-size item. Its default value
685 is 8192 (in KiB), while our Chord simulation works with stacks as small
686 as 16 KiB, for example. For the thread factory, the default value
687 is the one of the system but you can still change it with this parameter.
688
689 The operating system should only allocate memory for the pages of the
690 stack which are actually used and you might not need to use this in
691 most cases. However, this setting is very important when using the
692 model checker (see \ref options_mc_perf).
693
694 \subsection options_virt_guard_size Disabling stack guard pages
695
696 A stack guard page is usually used which prevents the stack of a given
697 actor from overflowing on another stack. But the performance impact
698 may become prohibitive when the amount of actors increases.  The
699 option \b contexts:guard-size is the number of stack guard pages used.
700 By setting it to 0, no guard pages will be used: in this case, you
701 should avoid using small stacks (\b stack-size) as the stack will
702 silently overflow on other parts of the memory.
703
704 When no stack guard page is created, stacks may then silently overflow
705 on other parts of the memory if their size is too small for the
706 application. This happens:
707
708 - on Windows systems;
709 - when the model checker is enabled;
710 - and of course when guard pages are explicitely disabled (with \b contexts:guard-size=0).
711
712 \subsection options_virt_parallel Running user code in parallel
713
714 Parallel execution of the user code is only considered stable in
715 SimGrid v3.7 and higher, and mostly for MSG simulations. SMPI
716 simulations may well fail in parallel mode. It is described in
717 <a href="http://hal.inria.fr/inria-00602216/">INRIA RR-7653</a>.
718
719 If you are using the \c ucontext or \c raw context factories, you can
720 request to execute the user code in parallel. Several threads are
721 launched, each of them handling as much user contexts at each run. To
722 actiave this, set the \b contexts/nthreads item to the amount of
723 cores that you have in your computer (or lower than 1 to have
724 the amount of cores auto-detected).
725
726 Even if you asked several worker threads using the previous option,
727 you can request to start the parallel execution (and pay the
728 associated synchronization costs) only if the potential parallelism is
729 large enough. For that, set the \b contexts/parallel-threshold
730 item to the minimal amount of user contexts needed to start the
731 parallel execution. In any given simulation round, if that amount is
732 not reached, the contexts will be run sequentially directly by the
733 main thread (thus saving the synchronization costs). Note that this
734 option is mainly useful when the grain of the user code is very fine,
735 because our synchronization is now very efficient.
736
737 When parallel execution is activated, you can choose the
738 synchronization schema used with the \b contexts/synchro item,
739 which value is either:
740  - \b futex: ultra optimized synchronisation schema, based on futexes
741    (fast user-mode mutexes), and thus only available on Linux systems.
742    This is the default mode when available.
743  - \b posix: slow but portable synchronisation using only POSIX
744    primitives.
745  - \b busy_wait: not really a synchronisation: the worker threads
746    constantly request new contexts to execute. It should be the most
747    efficient synchronisation schema, but it loads all the cores of your
748    machine for no good reason. You probably prefer the other less
749    eager schemas.
750
751 \section options_tracing Configuring the tracing subsystem
752
753 The \ref outcomes_vizu "tracing subsystem" can be configured in several
754 different ways depending on the nature of the simulator (MSG, SimDag,
755 SMPI) and the kind of traces that need to be obtained. See the \ref
756 tracing_tracing_options "Tracing Configuration Options subsection" to
757 get a detailed description of each configuration option.
758
759 We detail here a simple way to get the traces working for you, even if
760 you never used the tracing API.
761
762
763 - Any SimGrid-based simulator (MSG, SimDag, SMPI, ...) and raw traces:
764 \verbatim
765 --cfg=tracing:yes --cfg=tracing/uncategorized:yes --cfg=triva/uncategorized:uncat.plist
766 \endverbatim
767     The first parameter activates the tracing subsystem, the second
768     tells it to trace host and link utilization (without any
769     categorization) and the third creates a graph configuration file
770     to configure Triva when analysing the resulting trace file.
771
772 - MSG or SimDag-based simulator and categorized traces (you need to declare categories and classify your tasks according to them)
773 \verbatim
774 --cfg=tracing:yes --cfg=tracing/categorized:yes --cfg=triva/categorized:cat.plist
775 \endverbatim
776     The first parameter activates the tracing subsystem, the second
777     tells it to trace host and link categorized utilization and the
778     third creates a graph configuration file to configure Triva when
779     analysing the resulting trace file.
780
781 - SMPI simulator and traces for a space/time view:
782 \verbatim
783 smpirun -trace ...
784 \endverbatim
785     The <i>-trace</i> parameter for the smpirun script runs the
786 simulation with --cfg=tracing:yes and --cfg=tracing/smpi:yes. Check the
787 smpirun's <i>-help</i> parameter for additional tracing options.
788
789 Sometimes you might want to put additional information on the trace to
790 correctly identify them later, or to provide data that can be used to
791 reproduce an experiment. You have two ways to do that:
792
793 - Add a string on top of the trace file as comment:
794 \verbatim
795 --cfg=tracing/comment:my_simulation_identifier
796 \endverbatim
797
798 - Add the contents of a textual file on top of the trace file as comment:
799 \verbatim
800 --cfg=tracing/comment-file:my_file_with_additional_information.txt
801 \endverbatim
802
803 Please, use these two parameters (for comments) to make reproducible
804 simulations. For additional details about this and all tracing
805 options, check See the \ref tracing_tracing_options.
806
807 \section options_msg Configuring MSG
808
809 \subsection options_msg_debug_multiple_use Debugging MSG
810
811 Sometimes your application may try to send a task that is still being
812 executed somewhere else, making it impossible to send this task. However,
813 for debugging purposes, one may want to know what the other host is/was
814 doing. This option shows a backtrace of the other process.
815
816 Enable this option by adding
817
818 \verbatim
819 --cfg=msg/debug-multiple-use:on
820 \endverbatim
821
822 \section options_smpi Configuring SMPI
823
824 The SMPI interface provides several specific configuration items.
825 These are uneasy to see since the code is usually launched through the
826 \c smiprun script directly.
827
828 \subsection options_smpi_bench smpi/bench: Automatic benchmarking of SMPI code
829
830 In SMPI, the sequential code is automatically benchmarked, and these
831 computations are automatically reported to the simulator. That is to
832 say that if you have a large computation between a \c MPI_Recv() and a
833 \c MPI_Send(), SMPI will automatically benchmark the duration of this
834 code, and create an execution task within the simulator to take this
835 into account. For that, the actual duration is measured on the host
836 machine and then scaled to the power of the corresponding simulated
837 machine. The variable \b smpi/host-speed allows to specify the
838 computational speed of the host machine (in flop/s) to use when
839 scaling the execution times. It defaults to 20000, but you really want
840 to update it to get accurate simulation results.
841
842 When the code is constituted of numerous consecutive MPI calls, the
843 previous mechanism feeds the simulation kernel with numerous tiny
844 computations. The \b smpi/cpu-threshold item becomes handy when this
845 impacts badly the simulation performance. It specifies a threshold (in
846 seconds) below which the execution chunks are not reported to the
847 simulation kernel (default value: 1e-6).
848
849 \note
850     The option smpi/cpu-threshold ignores any computation time spent
851     below this threshold. SMPI does not consider the \a amount of these
852     computations; there is no offset for this. Hence, by using a
853     value that is too low, you may end up with unreliable simulation
854     results.
855
856 In some cases, however, one may wish to disable simulation of
857 application computation. This is the case when SMPI is used not to
858 simulate an MPI applications, but instead an MPI code that performs
859 "live replay" of another MPI app (e.g., ScalaTrace's replay tool,
860 various on-line simulators that run an app at scale). In this case the
861 computation of the replay/simulation logic should not be simulated by
862 SMPI. Instead, the replay tool or on-line simulator will issue
863 "computation events", which correspond to the actual MPI simulation
864 being replayed/simulated. At the moment, these computation events can
865 be simulated using SMPI by calling internal smpi_execute*() functions.
866
867 To disable the benchmarking/simulation of computation in the simulated
868 application, the variable \b smpi/simulate-computation should be set to no.
869
870 \note
871     This option just ignores the timings in your simulation; it still executes
872     the computations itself. If you want to stop SMPI from doing that,
873     you should check the SMPI_SAMPLE macros, documented in the section
874     \ref SMPI_adapting_speed.
875
876 Solution                           | Computations actually executed? | Computations simulated ?
877 ---------------------------------- | ------------------------------- | ------------------------
878 --cfg=smpi/simulate-computation:no | Yes                             | No, never
879 --cfg=smpi/cpu-threshold:42        | Yes, in all cases               | Only if it lasts more than 42 seconds
880 SMPI_SAMPLE() macro                | Only once per loop nest (see @ref SMPI_adapting_speed "documentation") | Always
881
882 \subsection options_model_smpi_adj_file smpi/comp-adjustment-file: Slow-down or speed-up parts of your code.
883
884 This option allows you to pass a file that contains two columns: The first column
885 defines the section that will be subject to a speedup; the second column is the speedup.
886
887 For instance:
888
889 \verbatim
890 "start:stop","ratio"
891 "exchange_1.f:30:exchange_1.f:130",1.18244559422142
892 \endverbatim
893
894 The first line is the header - you must include it.
895 The following line means that the code between two consecutive MPI calls on
896 line 30 in exchange_1.f and line 130 in exchange_1.f should receive a speedup
897 of 1.18244559422142. The value for the second column is therefore a speedup, if it is
898 larger than 1 and a slow-down if it is smaller than 1. Nothing will be changed if it is
899 equal to 1.
900
901 Of course, you can set any arbitrary filenames you want (so the start and end don't have to be
902 in the same file), but be aware that this mechanism only supports @em consecutive calls!
903
904 \note
905     Please note that you must pass the \b -trace-call-location flag to smpicc
906     or smpiff, respectively! This flag activates some macro definitions in our
907     mpi.h / mpi.f files that help with obtaining the call location.
908
909 \subsection options_model_smpi_bw_factor smpi/bw-factor: Bandwidth factors
910
911 The possible throughput of network links is often dependent on the
912 message sizes, as protocols may adapt to different message sizes. With
913 this option, a series of message sizes and factors are given, helping
914 the simulation to be more realistic. For instance, the current
915 default value is
916
917 \verbatim
918 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
919 \endverbatim
920
921 So, messages with size 65472 and more will get a total of MAX_BANDWIDTH*0.940694,
922 messages of size 15424 to 65471 will get MAX_BANDWIDTH*0.697866 and so on.
923 Here, MAX_BANDWIDTH denotes the bandwidth of the link.
924
925 \note
926     The SimGrid-Team has developed a script to help you determine these
927     values. You can find more information and the download here:
928     1. http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc.html
929     2. http://simgrid.gforge.inria.fr/contrib/smpi-saturation-doc.html
930
931 \subsection options_smpi_timing smpi/display-timing: Reporting simulation time
932
933 \b Default: 0 (false)
934
935 Most of the time, you run MPI code with SMPI to compute the time it
936 would take to run it on a platform. But since the
937 code is run through the \c smpirun script, you don't have any control
938 on the launcher code, making it difficult to report the simulated time
939 when the simulation ends. If you set the \b smpi/display-timing item
940 to 1, \c smpirun will display this information when the simulation ends. \verbatim
941 Simulation time: 1e3 seconds.
942 \endverbatim
943
944 \subsection options_smpi_temps smpi/keep-temps: not cleaning up after simulation
945
946 \b Default: 0 (false)
947
948 Under some conditions, SMPI generates a lot of temporary files.  They
949 usually get cleaned, but you may use this option to not erase these
950 files. This is for example useful when debugging or profiling
951 executions using the dlopen privatization schema, as missing binary
952 files tend to fool the debuggers.
953
954 \subsection options_model_smpi_lat_factor smpi/lat-factor: Latency factors
955
956 The motivation and syntax for this option is identical to the motivation/syntax
957 of smpi/bw-factor, see \ref options_model_smpi_bw_factor for details.
958
959 There is an important difference, though: While smpi/bw-factor \a reduces the
960 actual bandwidth (i.e., values between 0 and 1 are valid), latency factors
961 increase the latency, i.e., values larger than or equal to 1 are valid here.
962
963 This is the default value:
964
965 \verbatim
966 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
967 \endverbatim
968
969 \note
970     The SimGrid-Team has developed a script to help you determine these
971     values. You can find more information and the download here:
972     1. http://simgrid.gforge.inria.fr/contrib/smpi-calibration-doc.html
973     2. http://simgrid.gforge.inria.fr/contrib/smpi-saturation-doc.html
974
975 \subsection options_smpi_papi_events smpi/papi-events: Trace hardware counters with PAPI
976
977 \warning 
978     This option is experimental and will be subject to change.
979     This feature currently requires superuser privileges, as registers are queried.
980     Only use this feature with code you trust! Call smpirun for instance via
981         smpirun -wrapper "sudo " <your-parameters>
982     or run sudo sh -c "echo 0 > /proc/sys/kernel/perf_event_paranoid"
983     In the later case, sudo will not be required.
984
985 \note
986     This option is only available when SimGrid was compiled with PAPI support.
987
988 This option takes the names of PAPI counters and adds their respective values
989 to the trace files. (See Section \ref tracing_tracing_options.)
990
991 It is planned to make this feature available on a per-process (or per-thread?) basis.
992 The first draft, however, just implements a "global" (i.e., for all processes) set
993 of counters, the "default" set.
994
995 \verbatim
996 --cfg=smpi/papi-events:"default:PAPI_L3_LDM:PAPI_L2_LDM"
997 \endverbatim
998
999 \subsection options_smpi_privatization smpi/privatization: Automatic privatization of global variables
1000
1001 MPI executables are usually meant to be executed in separated processes, but SMPI is
1002 executed in only one process. Global variables from executables will be placed
1003 in the same memory zone and shared between processes, causing intricate bugs.
1004 Several options are possible to avoid this, as described in the main
1005 <a href="https://hal.inria.fr/hal-01415484">SMPI publication</a>.
1006 SimGrid provides two ways of automatically privatizing the globals,
1007 and this option allows to choose between them.
1008
1009   - <b>no</b> (default): Do not automatically privatize variables.
1010   - <b>mmap</b> or <b>yes</b>: Runtime automatic switching of the data segments.\n
1011     SMPI stores a copy of each global data segment for each process,
1012     and at each context switch replaces the actual data with its copy
1013     from the right process. No copy actually occures as this mechanism
1014     uses mmap for efficiency. As such, it is for now limited to
1015     systems supporting this functionnality (all Linux and most BSD).\n
1016     Another limitation is that SMPI only accounts for global variables
1017     defined in the executable. If the processes use external global
1018     variables from dynamic libraries, they won't be switched
1019     correctly. The easiest way to solve this is to statically link
1020     against the library with these globals (but you should never
1021     statically link against the simgrid library itself).
1022   - <b>dlopen</b>: Link multiple times against the binary.\n  
1023     SMPI loads several copy of the same binary in memory, resulting in
1024     the natural duplication global variables. Since the dynamic linker
1025     refuses to link the same file several times, the binary is copied
1026     in a temporary file before being dl-loaded (it is erased right
1027     after loading).\n
1028     Note that this feature is somewhat experimental at time of writing
1029     (v3.16) but seems to work.\n
1030     This approach greatly speeds up the context switching, down to
1031     about 40 CPU cycles with our raw contextes, instead of requesting
1032     several syscalls with the \c mmap approach. Another advantage is
1033     that it permits to run the SMPI contexts in parallel, which is
1034     obviously not possible with the \c mmap approach.\n
1035     Further work may be possible to alleviate the memory and disk
1036     overconsumption. It seems that we could 
1037     <a href="https://lwn.net/Articles/415889/">punch holes</a>
1038     in the files before dl-loading them to remove the code and
1039     constants, and mmap these area onto a unique copy. This require
1040     to understand the ELF layout of the file, but would 
1041     reduce the disk- and memory- usage to the bare minimum. In
1042     addition, this would reduce the pressure on the CPU caches (in
1043     particular on instruction one).
1044
1045 \warning
1046   This configuration option cannot be set in your platform file. You can only
1047   pass it as an argument to smpirun.
1048
1049 \subsection options_model_smpi_detached Simulating MPI detached send
1050
1051 This threshold specifies the size in bytes under which the send will return
1052 immediately. This is different from the threshold detailed in  \ref options_model_network_asyncsend
1053 because the message is not effectively sent when the send is posted. SMPI still waits for the
1054 correspondant receive to be posted to perform the communication operation. This threshold can be set
1055 by changing the \b smpi/send-is-detached-thresh item. The default value is 65536.
1056
1057 \subsection options_model_smpi_collectives Simulating MPI collective algorithms
1058
1059 SMPI implements more than 100 different algorithms for MPI collective communication, to accurately
1060 simulate the behavior of most of the existing MPI libraries. The \b smpi/coll-selector item can be used
1061  to use the decision logic of either OpenMPI or MPICH libraries (values: ompi or mpich, by default SMPI
1062 uses naive version of collective operations). Each collective operation can be manually selected with a
1063 \b smpi/collective_name:algo_name. Available algorithms are listed in \ref SMPI_use_colls .
1064
1065 \subsection options_model_smpi_iprobe smpi/iprobe: Inject constant times for calls to MPI_Iprobe
1066
1067 \b Default value: 0.0001
1068
1069 The behavior and motivation for this configuration option is identical with \a smpi/test, see
1070 Section \ref options_model_smpi_test for details.
1071
1072 \subsection options_model_smpi_iprobe_cpu_usage smpi/iprobe-cpu-usage: Reduce speed for iprobe calls
1073
1074 \b Default value: 1 (no change from default behavior)
1075
1076 MPI_Iprobe calls can be heavily used in applications. To account correctly for the energy
1077 cores spend probing, it is necessary to reduce the load that these calls cause inside
1078 SimGrid.
1079
1080 For instance, we measured a max power consumption of 220 W for a particular application but 
1081 only 180 W while this application was probing. Hence, the correct factor that should
1082 be passed to this option would be 180/220 = 0.81.
1083
1084 \subsection options_model_smpi_init smpi/init: Inject constant times for calls to MPI_Init
1085
1086 \b Default value: 0
1087
1088 The behavior for this configuration option is identical with \a smpi/test, see
1089 Section \ref options_model_smpi_test for details.
1090
1091 \subsection options_model_smpi_ois smpi/ois: Inject constant times for asynchronous send operations
1092
1093 This configuration option works exactly as \a smpi/os, see Section \ref options_model_smpi_os.
1094 Of course, \a smpi/ois is used to account for MPI_Isend instead of MPI_Send.
1095
1096 \subsection options_model_smpi_os smpi/os: Inject constant times for send operations
1097
1098 In several network models such as LogP, send (MPI_Send, MPI_Isend) and receive (MPI_Recv)
1099 operations incur costs (i.e., they consume CPU time). SMPI can factor these costs in as well, but the
1100 user has to configure SMPI accordingly as these values may vary by machine.
1101 This can be done by using smpi/os for MPI_Send operations; for MPI_Isend and
1102 MPI_Recv, use \a smpi/ois and \a smpi/or, respectively. These work exactly as
1103 \a smpi/ois.
1104
1105 \a smpi/os can consist of multiple sections; each section takes three values, for example:
1106
1107 \verbatim
1108     1:3:2;10:5:1
1109 \endverbatim
1110
1111 Here, the sections are divided by ";" (that is, this example contains two sections).
1112 Furthermore, each section consists of three values.
1113
1114 1. The first value denotes the minimum size for this section to take effect;
1115    read it as "if message size is greater than this value (and other section has a larger
1116    first value that is also smaller than the message size), use this".
1117    In the first section above, this value is "1".
1118
1119 2. The second value is the startup time; this is a constant value that will always
1120    be charged, no matter what the size of the message. In the first section above,
1121    this value is "3".
1122
1123 3. The third value is the \a per-byte cost. That is, it is charged for every
1124    byte of the message (incurring cost messageSize*cost_per_byte)
1125    and hence accounts also for larger messages. In the first
1126    section of the example above, this value is "2".
1127
1128 Now, SMPI always checks which section it should take for a given message; that is,
1129 if a message of size 11 is sent with the configuration of the example above, only
1130 the second section will be used, not the first, as the first value of the second
1131 section is closer to the message size. Hence, a message of size 11 incurs the
1132 following cost inside MPI_Send:
1133
1134 \verbatim
1135     5+11*1
1136 \endverbatim
1137
1138 As 5 is the startup cost and 1 is the cost per byte.
1139
1140 \note
1141     The order of sections can be arbitrary; they will be ordered internally.
1142
1143 \subsection options_model_smpi_or smpi/or: Inject constant times for receive operations
1144
1145 This configuration option works exactly as \a smpi/os, see Section \ref options_model_smpi_os.
1146 Of course, \a smpi/or is used to account for MPI_Recv instead of MPI_Send.
1147
1148 \subsection options_model_smpi_test smpi/test: Inject constant times for calls to MPI_Test
1149
1150 \b Default value: 0.0001
1151
1152 By setting this option, you can control the amount of time a process sleeps
1153 when MPI_Test() is called; this is important, because SimGrid normally only
1154 advances the time while communication is happening and thus,
1155 MPI_Test will not add to the time, resulting in a deadlock if used as a
1156 break-condition.
1157
1158 Here is an example:
1159
1160 \code{.unparsed}
1161     while(!flag) {
1162         MPI_Test(request, flag, status);
1163         ...
1164     }
1165 \endcode
1166
1167 \note
1168     Internally, in order to speed up execution, we use a counter to keep track
1169     on how often we already checked if the handle is now valid or not. Hence, we
1170     actually use counter*SLEEP_TIME, that is, the time MPI_Test() causes the process
1171     to sleep increases linearly with the number of previously failed tests. This 
1172     behavior can be disabled by setting smpi/grow-injected-times to no. This will
1173     also disable this behavior for MPI_Iprobe.
1174
1175
1176 \subsection options_model_smpi_shared_malloc smpi/shared-malloc: Factorize malloc()s
1177
1178 \b Default: global
1179
1180 If your simulation consumes too much memory, you may want to modify
1181 your code so that the working areas are shared by all MPI ranks. For
1182 example, in a bloc-cyclic matrix multiplication, you will only
1183 allocate one set of blocs, and every processes will share them.
1184 Naturally, this will lead to very wrong results, but this will save a
1185 lot of memory so this is still desirable for some studies. For more on
1186 the motivation for that feature, please refer to the 
1187 <a href="https://simgrid.github.io/SMPI_CourseWare/topic_understanding_performance/matrixmultiplication/">relevant
1188 section</a> of the SMPI CourseWare (see Activity #2.2 of the pointed
1189 assignment). In practice, change the call to malloc() and free() into
1190 SMPI_SHARED_MALLOC() and SMPI_SHARED_FREE().
1191
1192 SMPI provides 2 algorithms for this feature. The first one, called \c
1193 local, allocates one bloc per call to SMPI_SHARED_MALLOC() in your
1194 code (each call location gets its own bloc) and this bloc is shared
1195 amongst all MPI ranks.  This is implemented with the shm_* functions
1196 to create a new POSIX shared memory object (kept in RAM, in /dev/shm)
1197 for each shared bloc.
1198
1199 With the \c global algorithm, each call to SMPI_SHARED_MALLOC()
1200 returns a new adress, but it only points to a shadow bloc: its memory
1201 area is mapped on a 1MiB file on disk. If the returned bloc is of size
1202 N MiB, then the same file is mapped N times to cover the whole bloc. 
1203 At the end, no matter how many SMPI_SHARED_MALLOC you do, this will
1204 only consume 1 MiB in memory. 
1205
1206 You can disable this behavior and come back to regular mallocs (for
1207 example for debugging purposes) using \c "no" as a value.
1208
1209 If you want to keep private some parts of the buffer, for instance if these
1210 parts are used by the application logic and should not be corrupted, you
1211 can use SMPI_PARTIAL_SHARED_MALLOC(size, offsets, offsets_count).
1212
1213 As an example,
1214
1215 \code{.C}
1216     mem = SMPI_PARTIAL_SHARED_MALLOC(500, {27,42 , 100,200}, 2);
1217 \endcode
1218
1219 will allocate 500 bytes to mem, such that mem[27..41] and mem[100..199]
1220 are shared and other area remain private.
1221
1222 Then, it can be deallocated by calling SMPI_SHARED_FREE(mem).
1223
1224 When smpi/shared-malloc:global is used, the memory consumption problem
1225 is solved, but it may induce too much load on the kernel's pages table. 
1226 In this case, you should use huge pages so that we create only one
1227 entry per Mb of malloced data instead of one entry per 4k.
1228 To activate this, you must mount a hugetlbfs on your system and allocate
1229 at least one huge page:
1230
1231 \code{.sh}
1232     mkdir /home/huge
1233     sudo mount none /home/huge -t hugetlbfs -o rw,mode=0777
1234     sudo sh -c 'echo 1 > /proc/sys/vm/nr_hugepages' # echo more if you need more
1235 \endcode
1236
1237 Then, you can pass the option --cfg=smpi/shared-malloc-hugepage:/home/huge
1238 to smpirun to actually activate the huge page support in shared mallocs.
1239
1240 \subsection options_model_smpi_wtime smpi/wtime: Inject constant times for calls to MPI_Wtime
1241
1242 \b Default value: 0
1243
1244 By setting this option, you can control the amount of time a process sleeps
1245 when MPI_Wtime() is called; this is important, because SimGrid normally only
1246 advances the time while communication is happening and thus,
1247 MPI_Wtime will not add to the time, resulting in a deadlock if used as a
1248 break-condition.
1249
1250 Here is an example:
1251
1252 \code{.unparsed}
1253     while(MPI_Wtime() < some_time_bound) {
1254         ...
1255     }
1256 \endcode
1257
1258 If the time is never advanced, this loop will clearly never end as MPI_Wtime()
1259 always returns the same value. Hence, pass a (small) value to the smpi/wtime
1260 option to force a call to MPI_Wtime to advance the time as well.
1261
1262
1263 \section options_generic Configuring other aspects of SimGrid
1264
1265 \subsection options_generic_clean_atexit Cleanup before termination
1266
1267 The C / C++ standard contains a function called \b [atexit](http://www.cplusplus.com/reference/cstdlib/atexit/).
1268 atexit registers callbacks, which are called just before the program terminates.
1269
1270 By setting the configuration option clean-atexit to 1 (true), a callback
1271 is registered and will clean up some variables and terminate/cleanup the tracing.
1272
1273 TODO: Add when this should be used.
1274
1275 \subsection options_generic_path XML file inclusion path
1276
1277 It is possible to specify a list of directories to search into for the
1278 \<include\> tag in XML files by using the \b path configuration
1279 item. To add several directory to the path, set the configuration
1280 item several times, as in \verbatim
1281 --cfg=path:toto --cfg=path:tutu
1282 \endverbatim
1283
1284 \subsection options_generic_exit Behavior on Ctrl-C
1285
1286 By default, when Ctrl-C is pressed, the status of all existing
1287 simulated processes is displayed before exiting the simulation. This is very useful to debug your
1288 code, but it can reveal troublesome in some cases (such as when the
1289 amount of processes becomes really big). This behavior is disabled
1290 when \b verbose-exit is set to 0 (it is to 1 by default).
1291
1292 \subsection options_exception_cutpath Truncate local path from exception backtrace
1293
1294 \verbatim
1295 --cfg=exceptions/cutpath:1
1296 \endverbatim
1297
1298 This configuration option is used to remove the path from the
1299 backtrace shown when an exception is thrown. This is mainly useful for
1300 the tests: the full file path makes the tests not reproducible, and
1301 thus failing as we are currently comparing output. Clearly, the path
1302 used on different machines are almost guaranteed to be different and
1303 hence, the output would mismatch, causing the test to fail.
1304
1305 \section options_log Logging Configuration
1306
1307 It can be done by using XBT. Go to \ref XBT_log for more details.
1308
1309 */