1 /*! \page options Simgrid options and configurations
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.
10 \section options_using Passing configuration options to the simulators
12 There is several way to pass configuration options to the simulators.
13 The most common way is to use the \c --cfg command line argument. For
14 example, to set the item \c Item to the value \c Value, simply
15 type the following: \verbatim
16 my_simulator --cfg=Item:Value (other arguments)
19 Several \c --cfg command line arguments can naturally be used. If you
20 need to include spaces in the argument, don't forget to quote the
21 argument. You can even escape the included quotes (write \' for ' if
22 you have your argument between ').
24 Another solution is to use the \c \<config\> tag in the platform file. The
25 only restriction is that this tag must occure before the first
26 platform element (be it \c \<AS\>, \c \<cluster\>, \c \<peer\> or whatever).
27 The \c \<config\> tag takes an \c id attribute, but it is currently
28 ignored so you don't really need to pass it. The important par is that
29 within that tag, you can pass one or several \c \<prop\> tags to specify
30 the configuration to use. For example, setting \c Item to \c Value
31 can be done by adding the following to the beginning of your platform
34 <prop id="Item" value="Value"/>
38 A last solution is to pass your configuration directly using the C
39 interface. Unfortunately, this path is not really easy to use right
40 now, and you mess directly with surf internal variables as follows. Check the
41 \ref XBT_config "relevant page" for details on all the functions you
42 can use in this context, \c _surf_cfg_set being the only configuration set
43 currently used in SimGrid. \code
44 #include <xbt/config.h>
46 extern xbt_cfg_t _surf_cfg_set;
48 int main(int argc, char *argv[]) {
49 MSG_init(&argc, argv);
51 xbt_cfg_set_parse(_surf_cfg_set,"Item:Value");
57 \section options_model Configuring the platform models
59 \subsection options_model_select Selecting the platform models
61 SimGrid comes with several network and CPU models built in, and you
62 can change the used model at runtime by changing the passed
63 configuration. The three main configuration items are given below.
64 For each of these items, passing the special \c help value gives
65 you a short description of all possible values. Also, \c --help-models
66 should provide information about all models for all existing resources.
67 - \b network/model: specify the used network model
68 - \b cpu/model: specify the used CPU model
69 - \b workstation/model: specify the used workstation model
71 As of writting, the accepted network models are the following. Over
72 the time new models can be added, and some experimental models can be
73 removed; check the values on your simulators for an uptodate
74 information. Note that the CM02 model is described in the research report
75 <a href="ftp://ftp.ens-lyon.fr/pub/LIP/Rapports/RR/RR2002/RR2002-40.ps.gz">A
76 Network Model for Simulation of Grid Application</a> while LV08 is
78 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>.
80 - \b LV08 (default one): Realistic network analytic model
81 (slow-start modeled by multiplying latency by 10.4, bandwidth by
82 .92; bottleneck sharing uses a payload of S=8775 for evaluating RTT)
83 - \b Constant: Simplistic network model where all communication
84 take a constant time (one second). This model provides the lowest
85 realism, but is (marginally) faster.
86 - \b SMPI: Realistic network model specifically tailored for HPC
87 settings (accurate modeling of slow start with correction factors on
88 three intervals: < 1KiB, < 64 KiB, >= 64 KiB). See also \ref
89 options_model_network_coefs "this section" for more info.
90 - \b CM02: Legacy network analytic model (Very similar to LV08, but
91 without corrective factors. The timings of small messages are thus
93 - \b Reno: Model from Steven H. Low using lagrange_solve instead of
94 lmm_solve (experts only; check the code for more info).
95 - \b Reno2: Model from Steven H. Low using lagrange_solve instead of
96 lmm_solve (experts only; check the code for more info).
97 - \b Vegas: Model from Steven H. Low using lagrange_solve instead of
98 lmm_solve (experts only; check the code for more info).
100 If you compiled SimGrid accordingly, you can use packet-level network
101 simulators as network models (see \ref pls). In that case, you have
102 two extra models, described below, and some \ref options_pls "specific
103 additional configuration flags".
104 - \b GTNets: Network pseudo-model using the GTNets simulator instead
106 - \b NS3: Network pseudo-model using the NS3 tcp model instead of an
109 Concerning the CPU, we have only one model for now:
110 - \b Cas01: Simplistic CPU model (time=size/power)
112 The workstation concept is the aggregation of a CPU with a network
113 card. Three models exists, but actually, only 2 of them are
114 interesting. The "compound" one is simply due to the way our internal
115 code is organized, and can easily be ignored. So at the end, you have
116 two workstation models: The default one allows to aggregate an
117 existing CPU model with an existing network model, but does not allow
118 parallel tasks because these beasts need some collaboration between
119 the network and CPU model. That is why, ptask_07 is used by default
121 - \b default: Default workstation model. Currently, CPU:Cas01 and
122 network:LV08 (with cross traffic enabled)
123 - \b compound: Workstation model that is automatically chosen if
124 you change the network and CPU models
125 - \b ptask_L07: Workstation model somehow similar to Cas01+CM02 but
126 allowing parallel tasks
128 \subsection options_model_optim Optimization level of the platform models
130 The network and CPU models that are based on lmm_solve (that
131 is, all our analytical models) accept specific optimization
133 - items \b network/optim and \b CPU/optim (both default to 'Lazy'):
134 - \b Lazy: Lazy action management (partial invalidation in lmm +
135 heap in action remaining).
136 - \b TI: Trace integration. Highly optimized mode when using
137 availability traces (only available for the Cas01 CPU model for
139 - \b Full: Full update of remaining and variables. Slow but may be
140 useful when debugging.
141 - items \b network/maxmin_selective_update and
142 \b cpu/maxmin_selective_update: configure whether the underlying
143 should be lazily updated or not. It should have no impact on the
144 computed timings, but should speed up the computation.
146 It is still possible to disable the \c maxmin_selective_update feature
147 because it can reveal counter-productive in very specific scenarios
148 where the interaction level is high. In particular, if all your
149 communication share a given backbone link, you should disable it:
150 without \c maxmin_selective_update, every communications are updated
151 at each step through a simple loop over them. With that feature
152 enabled, every communications will still get updated in this case
153 (because of the dependency induced by the backbone), but through a
154 complicated pattern aiming at following the actual dependencies.
156 \subsection options_model_precision Numerical precision of the platform models
158 The analytical models handle a lot of floating point values. It is
159 possible to change the epsilon used to update and compare them through
160 the \b maxmin/precision item (default value: 0.00001). Changing it
161 may speedup the simulation by discarding very small actions, at the
162 price of a reduced numerical precision.
164 \subsection options_model_nthreads Parallel threads for model updates
166 By default, Surf computes the analytical models sequentially to share their
167 resources and update their actions. It is possible to run them in parallel,
168 using the \b surf/nthreads item (default value: 1). If you use a
169 negative value, the amount of available cores is automatically
170 detected and used instead.
172 Depending on the workload of the models and their complexity, you may get a
173 speedup or a slowdown because of the synchronization costs of threads.
175 \subsection options_model_network Configuring the Network model
177 \subsubsection options_model_network_gamma Maximal TCP window size
179 The analytical models need to know the maximal TCP window size to take
180 the TCP congestion mechanism into account. This is set to 20000 by
181 default, but can be changed using the \b network/TCP_gamma item.
183 On linux, this value can be retrieved using the following
184 commands. Both give a set of values, and you should use the last one,
185 which is the maximal size.\verbatim
186 cat /proc/sys/net/ipv4/tcp_rmem # gives the sender window
187 cat /proc/sys/net/ipv4/tcp_wmem # gives the receiver window
190 \subsubsection options_model_network_coefs Corrective simulation factors
192 These factors allow to betterly take the slow start into account.
193 The corresponding values were computed through data fitting one the
194 timings of packet-level simulators. You should not change these values
195 unless you are really certain of what you are doing. See
196 <a href="http://mescal.imag.fr/membres/arnaud.legrand/articles/simutools09.pdf">Accuracy Study and Improvement of Network Simulation in the SimGrid Framework</a>
197 for more informations about these coeficients.
199 If you are using the SMPI model, these correction coeficients are
200 themselves corrected by constant values depending on the size of the
201 exchange. Again, only hardcore experts should bother about this fact.
203 \subsubsection options_model_network_crosstraffic Simulating cross-traffic
205 As of SimGrid v3.7, cross-traffic effects can be taken into account in
206 analytical simulations. It means that ongoing and incoming
207 communication flows are treated independently. In addition, the LV08
208 model adds 0.05 of usage on the opposite direction for each new
209 created flow. This can be useful to simulate some important TCP
210 phenomena such as ack compression.
212 For that to work, your platform must have two links for each
213 pair of interconnected hosts. An example of usable platform is
214 available in <tt>examples/msg/gtnets/crosstraffic-p.xml</tt>.
216 This is activated through the \b network/crosstraffic item, that
217 can be set to 0 (disable this feature) or 1 (enable it).
219 Note that with the default workstation model this option is activated by default.
221 \subsubsection options_model_network_coord Coordinated-based network models
223 When you want to use network coordinates, as it happens when you use
224 an \<AS\> in your platform file with \c Vivaldi as a routing, you must
225 set the \b network/coordinates to \c yes so that all mandatory
226 initialization are done in the simulator.
228 \subsubsection options_model_network_sendergap Simulating sender gap
230 (this configuration item is experimental and may change or disapear)
232 It is possible to specify a timing gap between consecutive emission on
233 the same network card through the \b network/sender_gap item. This
234 is still under investigation as of writting, and the default value is
235 to wait 0 seconds between emissions (no gap applied).
237 \subsubsection options_pls Configuring packet-level pseudo-models
239 When using the packet-level pseudo-models, several specific
240 configuration flags are provided to configure the associated tools.
241 There is by far not enough such SimGrid flags to cover every aspects
242 of the associated tools, since we only added the items that we
243 needed ourselves. Feel free to request more items (or even better:
244 provide patches adding more items).
246 When using NS3, the only existing item is \b ns3/TcpModel,
247 corresponding to the ns3::TcpL4Protocol::SocketType configuration item
248 in NS3. The only valid values (enforced on the SimGrid side) are
249 'NewReno' or 'Reno' or 'Tahoe'.
251 When using GTNeTS, two items exist:
252 - \b gtnets/jitter, that is a double value to oscillate
253 the link latency, uniformly in random interval
254 [-latency*gtnets_jitter,latency*gtnets_jitter). It defaults to 0.
255 - \b gtnets/jitter_seed, the positive seed used to reproduce jitted
256 results. Its value must be in [1,1e8] and defaults to 10.
258 \section options_modelchecking Configuring the Model-Checking
260 To enable the experimental SimGrid model-checking support the program should
261 be executed with the command line argument
265 Safety properties are expressed as assertions using the function
267 void MC_assert(int prop);
270 \subsection options_modelchecking_liveness Specifying a liveness property
272 If you want to specify liveness properties (beware, that's
273 experimental), you have to pass them on the command line, specifying
274 the name of the file containing the property, as formated by the
278 --cfg=model-check/property:<filename>
281 Of course, specifying a liveness property enables the model-checking
282 so that you don't have to give <tt>--cfg=model-check:1</tt> in
285 \subsection options_modelchecking_steps Going for stateful verification
287 By default, the system is backtracked to its initial state to explore
288 another path instead of backtracking to the exact step before the fork
289 that we want to explore (this is called stateless verification). This
290 is done this way because saving intermediate states can rapidly
291 exhaust the available memory. If you want, you can change the value of
292 the <tt>model-check/checkpoint</tt> variable. For example, the
293 following configuration will ask to take a checkpoint every step.
294 Beware, this will certainly explode your memory. Larger values are
295 probably better, make sure to experiment a bit to find the right
296 setting for your specific system.
299 --cfg=model-check/checkpoint:1
302 Of course, specifying this option enables the model-checking so that
303 you don't have to give <tt>--cfg=model-check:1</tt> in addition.
305 \subsection options_modelchecking_reduction Specifying the kind of reduction
307 The main issue when using the model-checking is the state space
308 explosion. To counter that problem, several exploration reduction
309 techniques can be used. There is unfortunately no silver bullet here,
310 and the most efficient reduction techniques cannot be applied to any
311 properties. In particular, the DPOR method cannot be applied on
312 liveness properties since it may break some cycles in the exploration
313 that are important to the property validity.
316 --cfg=model-check/reduction:<technique>
319 For now, this configuration variable can take 2 values:
320 * none: Do not apply any kind of reduction (mandatory for now for
322 * dpor: Apply Dynamic Partial Ordering Reduction. Only valid if you
323 verify local safety properties.
325 Of course, specifying a reduction technique enables the model-checking
326 so that you don't have to give <tt>--cfg=model-check:1</tt> in
329 \section options_virt Configuring the User Process Virtualization
331 \subsection options_virt_factory Selecting the virtualization factory
333 In SimGrid, the user code is virtualized in a specific mecanism
334 allowing the simulation kernel to control its execution: when a user
335 process requires a blocking action (such as sending a message), it is
336 interrupted, and only gets released when the simulated clock reaches
337 the point where the blocking operation is done.
339 In SimGrid, the containers in which user processes are virtualized are
340 called contexts. Several context factory are provided, and you can
341 select the one you want to use with the \b contexts/factory
342 configuration item. Some of the following may not exist on your
343 machine because of portability issues. In any case, the default one
344 should be the most effcient one (please report bugs if the
345 auto-detection fails for you). They are sorted here from the slowest
347 - \b thread: very slow factory using full featured threads (either
348 pthreads or windows native threads)
349 - \b ucontext: fast factory using System V contexts (or a portability
350 layer of our own on top of Windows fibers)
351 - \b raw: amazingly fast factory using a context switching mecanism
352 of our own, directly implemented in assembly (only available for x86
353 and amd64 platforms for now)
355 The only reason to change this setting is when the debugging tools get
356 fooled by the optimized context factories. Threads are the most
357 debugging-friendly contextes.
359 \subsection options_virt_stacksize Adapting the used stack size
361 Each virtualized used process is executed using a specific system
362 stack. The size of this stack has a huge impact on the simulation
363 scalability, but its default value is rather large. This is because
364 the error messages that you get when the stack size is too small are
365 rather disturbing: this leads to stack overflow (overwriting other
366 stacks), leading to segfaults with corrupted stack traces.
368 If you want to push the scalability limits of your code, you really
369 want to reduce the \b contexts/stack_size item. Its default value
370 is 128 (in Kib), while our Chord simulation works with stacks as small
371 as 16 Kib, for example. For the thread factory, the default value
372 is the one of the system, if it is too large/small, it has to be set
375 \subsection options_virt_parallel Running user code in parallel
377 Parallel execution of the user code is only considered stable in
378 SimGrid v3.7 and higher. It is described in
379 <a href="http://hal.inria.fr/inria-00602216/">INRIA RR-7653</a>.
381 If you are using the \c ucontext or \c raw context factories, you can
382 request to execute the user code in parallel. Several threads are
383 launched, each of them handling as much user contexts at each run. To
384 actiave this, set the \b contexts/nthreads item to the amount of
385 cores that you have in your computer (or -1 to have the amount of cores
388 Even if you asked several worker threads using the previous option,
389 you can request to start the parallel execution (and pay the
390 associated synchronization costs) only if the potential parallelism is
391 large enough. For that, set the \b contexts/parallel_threshold
392 item to the minimal amount of user contexts needed to start the
393 parallel execution. In any given simulation round, if that amount is
394 not reached, the contexts will be run sequentially directly by the
395 main thread (thus saving the synchronization costs). Note that this
396 option is mainly useful when the grain of the user code is very fine,
397 because our synchronization is now very efficient.
399 When parallel execution is activated, you can choose the
400 synchronization schema used with the \b contexts/synchro item,
401 which value is either:
402 - \b futex: ultra optimized synchronisation schema, based on futexes
403 (fast user-mode mutexes), and thus only available on Linux systems.
404 This is the default mode when available.
405 - \b posix: slow but portable synchronisation using only POSIX
407 - \b busy_wait: not really a synchronisation: the worker threads
408 constantly request new contexts to execute. It should be the most
409 efficient synchronisation schema, but it loads all the cores of your
410 machine for no good reason. You probably prefer the other less
413 \section options_tracing Configuring the tracing subsystem
415 The \ref tracing "tracing subsystem" can be configured in several
416 different ways depending on the nature of the simulator (MSG, SimDag,
417 SMPI) and the kind of traces that need to be obtained. See the \ref
418 tracing_tracing_options "Tracing Configuration Options subsection" to
419 get a detailed description of each configuration option.
421 We detail here a simple way to get the traces working for you, even if
422 you never used the tracing API.
425 - Any SimGrid-based simulator (MSG, SimDag, SMPI, ...) and raw traces:
427 --cfg=tracing:1 --cfg=tracing/uncategorized:1 --cfg=triva/uncategorized:uncat.plist
429 The first parameter activates the tracing subsystem, the second
430 tells it to trace host and link utilization (without any
431 categorization) and the third creates a graph configuration file
432 to configure Triva when analysing the resulting trace file.
434 - MSG or SimDag-based simulator and categorized traces (you need to declare categories and classify your tasks according to them)
436 --cfg=tracing:1 --cfg=tracing/categorized:1 --cfg=triva/categorized:cat.plist
438 The first parameter activates the tracing subsystem, the second
439 tells it to trace host and link categorized utilization and the
440 third creates a graph configuration file to configure Triva when
441 analysing the resulting trace file.
443 - SMPI simulator and traces for a space/time view:
447 The <i>-trace</i> parameter for the smpirun script runs the
448 simulation with --cfg=tracing:1 and --cfg=tracing/smpi:1. Check the
449 smpirun's <i>-help</i> parameter for additional tracing options.
451 Sometimes you might want to put additional information on the trace to
452 correctly identify them later, or to provide data that can be used to
453 reproduce an experiment. You have two ways to do that:
455 - Add a string on top of the trace file as comment:
457 --cfg=tracing/comment:my_simulation_identifier
460 - Add the contents of a textual file on top of the trace file as comment:
462 --cfg=tracing/comment_file:my_file_with_additional_information.txt
465 Please, use these two parameters (for comments) to make reproducible
466 simulations. For additional details about this and all tracing
467 options, check See the \ref tracing_tracing_options "Tracing
468 Configuration Options subsection".
470 \section options_smpi Configuring SMPI
472 The SMPI interface provides several specific configuration items.
473 These are uneasy to see since the code is usually launched through the
474 \c smiprun script directly.
476 \subsection options_smpi_bench Automatic benchmarking of SMPI code
478 In SMPI, the sequential code is automatically benchmarked, and these
479 computations are automatically reported to the simulator. That is to
480 say that if you have a large computation between a \c MPI_Recv() and a
481 \c MPI_Send(), SMPI will automatically benchmark the duration of this
482 code, and create an execution task within the simulator to take this
483 into account. For that, the actual duration is measured on the host
484 machine and then scaled to the power of the corresponding simulated
485 machine. The variable \b smpi/running_power allows to specify the
486 computational power of the host machine (in flop/s) to use when
487 scaling the execution times. It defaults to 20000, but you really want
488 to update it to get accurate simulation results.
490 When the code is constituted of numerous consecutive MPI calls, the
491 previous mechanism feeds the simulation kernel with numerous tiny
492 computations. The \b smpi/cpu_threshold item becomes handy when this
493 impacts badly the simulation performance. It specify a threshold (in
494 second) under which the execution chunks are not reported to the
495 simulation kernel (default value: 1e-6). Please note that in some
496 circonstances, this optimization can hinder the simulation accuracy.
498 \subsection options_smpi_timing Reporting simulation time
500 Most of the time, you run MPI code through SMPI to compute the time it
501 would take to run it on a platform that you don't have. But since the
502 code is run through the \c smpirun script, you don't have any control
503 on the launcher code, making difficult to report the simulated time
504 when the simulation ends. If you set the \b smpi/display_timing item
505 to 1, \c smpirun will display this information when the simulation ends. \verbatim
506 Simulation time: 1e3 seconds.
509 \section options_generic Configuring other aspects of SimGrid
511 \subsection options_generic_path XML file inclusion path
513 It is possible to specify a list of directories to search into for the
514 \<include\> tag in XML files by using the \b path configuration
515 item. To add several directory to the path, set the configuration
516 item several times, as in \verbatim
517 --cfg=path:toto --cfg=path:tutu
520 \subsection options_generic_exit Behavior on Ctrl-C
522 By default, when Ctrl-C is pressed, the status of all existing
523 simulated processes is displayed. This is very useful to debug your
524 code, but it can reveal troublesome in some cases (such as when the
525 amount of processes becomes really big). This behavior is disabled
526 when \b verbose-exit is set to 0 (it is to 1 by default).
529 \section options_log Logging Configuration
531 It can be done by using XBT. Go to \ref XBT_log for more details.
534 \section options_index Index of all existing configuration items
536 - \c contexts/factory: \ref options_virt_factory
537 - \c contexts/nthreads: \ref options_virt_parallel
538 - \c contexts/parallel_threshold: \ref options_virt_parallel
539 - \c contexts/stack_size: \ref options_virt_stacksize
540 - \c contexts/synchro: \ref options_virt_parallel
542 - \c cpu/maxmin_selective_update: \ref options_model_optim
543 - \c cpu/model: \ref options_model_select
544 - \c cpu/optim: \ref options_model_optim
546 - \c gtnets/jitter: \ref options_pls
547 - \c gtnets/jitter_seed: \ref options_pls
549 - \c maxmin/precision: \ref options_model_precision
551 - \c model-check: \ref options_modelchecking
552 - \c model-check/property: \ref options_modelchecking_liveness
553 - \c model-check/checkpoint: \ref options_modelchecking_steps
554 - \c model-check/reduce: \ref options_modelchecking_reduction
556 - \c network/bandwidth_factor: \ref options_model_network_coefs
557 - \c network/coordinates: \ref options_model_network_coord
558 - \c network/crosstraffic: \ref options_model_network_crosstraffic
559 - \c network/latency_factor: \ref options_model_network_coefs
560 - \c network/maxmin_selective_update: \ref options_model_optim
561 - \c network/model: \ref options_model_select
562 - \c network/optim: \ref options_model_optim
563 - \c network/sender_gap: \ref options_model_network_sendergap
564 - \c network/TCP_gamma: \ref options_model_network_gamma
565 - \c network/weight_S: \ref options_model_network_coefs
567 - \c ns3/TcpModel: \ref options_pls
569 - \c surf/nthreads: \ref options_model_nthreads
571 - \c smpi/running_power: \ref options_smpi_bench
572 - \c smpi/display_timing: \ref options_smpi_timing
573 - \c smpi/cpu_threshold: \ref options_smpi_bench
575 - \c path: \ref options_generic_path
576 - \c verbose-exit: \ref options_generic_exit
578 - \c workstation/model: \ref options_model_select