1 /* Copyright (c) 2009-2010, 2012-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 /* sg_config: configuration infrastructure for the simulation world */
10 #include "xbt/config.h"
12 #include "xbt/mallocator.h"
15 #include "xbt/sysdep.h"
16 #include "surf/surf.h"
17 #include "surf/maxmin.h"
18 #include "instr/instr_interface.h"
19 #include "simgrid/simix.h"
20 #include "simgrid/sg_config.h"
21 #include "smpi/smpi_interface.h"
23 #include "mc/mc_record.h"
24 #include "simgrid/instr.h"
26 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
27 "About the configuration of simgrid");
29 xbt_cfg_t _sg_cfg_set = NULL;
31 /* 0: beginning of time (config cannot be changed yet);
32 * 1: initialized: cfg_set created (config can now be changed);
33 * 2: configured: command line parsed and config part of platform file was
34 * integrated also, platform construction ongoing or done.
35 * (Config cannot be changed anymore!)
37 int _sg_cfg_init_status = 0;
39 /* instruct the upper layer (simix or simdag) to exit as soon as possible
41 int _sg_cfg_exit_asap = 0;
43 #define sg_cfg_exit_early() do { _sg_cfg_exit_asap = 1; return; } while (0)
45 /* Parse the command line, looking for options */
46 static void sg_config_cmd_line(int *argc, char **argv)
52 for (j = i = 1; i < *argc; i++) {
53 if (!strncmp(argv[i], "--cfg=", strlen("--cfg="))) {
54 opt = strchr(argv[i], '=');
57 xbt_cfg_set_parse(_sg_cfg_set, opt);
58 XBT_DEBUG("Did apply '%s' as config setting", opt);
59 } else if (!strcmp(argv[i], "--version")) {
60 printf("%s\n", SIMGRID_VERSION_STRING);
62 } else if (!strcmp(argv[i], "--cfg-help") || !strcmp(argv[i], "--help")) {
64 ("Description of the configuration accepted by this simulator:\n");
65 xbt_cfg_help(_sg_cfg_set);
68 "Each of these configurations can be used by adding\n"
69 " --cfg=<option name>:<option value>\n"
70 "to the command line.\n"
72 "You can also use --help-models to see the details of all models known by this simulator.\n"
74 "You can also use --help-tracing to see the details of all tracing options known by this simulator.\n"
76 "You can also use --help-logs and --help-log-categories to see the details of logging output.\n"
78 "You can also use --version to get SimGrid version information.\n"
82 } else if (!strcmp(argv[i], "--help-models")) {
85 model_help("workstation", surf_workstation_model_description);
87 model_help("CPU", surf_cpu_model_description);
89 model_help("network", surf_network_model_description);
90 printf("\nLong description of all optimization levels accepted by the models of this simulator:\n");
91 for (k = 0; surf_optimization_mode_description[k].name; k++)
93 surf_optimization_mode_description[k].name,
94 surf_optimization_mode_description[k].description);
95 printf("Both network and CPU models have 'Lazy' as default optimization level\n\n");
97 } else if (!strcmp(argv[i], "--help-tracing")) {
112 /* callback of the plugin variable */
113 static void _sg_cfg_cb__plugin(const char *name, int pos)
118 xbt_assert(_sg_cfg_init_status < 2,
119 "Cannot load a plugin after the initialization");
121 val = xbt_cfg_get_string(_sg_cfg_set, name);
123 if (!strcmp(val, "help")) {
124 model_help("plugin", surf_plugin_description);
128 /* New Module missing */
129 int plugin_id = find_model_description(surf_plugin_description, val);
130 surf_plugin_description[plugin_id].model_init_preparse();
133 /* callback of the workstation/model variable */
134 static void _sg_cfg_cb__workstation_model(const char *name, int pos)
138 xbt_assert(_sg_cfg_init_status < 2,
139 "Cannot change the model after the initialization");
141 val = xbt_cfg_get_string(_sg_cfg_set, name);
143 if (!strcmp(val, "help")) {
144 model_help("workstation", surf_workstation_model_description);
148 /* Make sure that the model exists */
149 find_model_description(surf_workstation_model_description, val);
152 /* callback of the vm_workstation/model variable */
153 static void _sg_cfg_cb__vm_workstation_model(const char *name, int pos)
157 xbt_assert(_sg_cfg_init_status < 2,
158 "Cannot change the model after the initialization");
160 val = xbt_cfg_get_string(_sg_cfg_set, name);
162 if (!strcmp(val, "help")) {
163 model_help("vm_workstation", surf_vm_workstation_model_description);
167 /* Make sure that the model exists */
168 find_model_description(surf_vm_workstation_model_description, val);
171 /* callback of the cpu/model variable */
172 static void _sg_cfg_cb__cpu_model(const char *name, int pos)
176 xbt_assert(_sg_cfg_init_status < 2,
177 "Cannot change the model after the initialization");
179 val = xbt_cfg_get_string(_sg_cfg_set, name);
181 if (!strcmp(val, "help")) {
182 model_help("CPU", surf_cpu_model_description);
186 /* New Module missing */
187 find_model_description(surf_cpu_model_description, val);
190 /* callback of the cpu/model variable */
191 static void _sg_cfg_cb__optimization_mode(const char *name, int pos)
195 xbt_assert(_sg_cfg_init_status < 2,
196 "Cannot change the model after the initialization");
198 val = xbt_cfg_get_string(_sg_cfg_set, name);
200 if (!strcmp(val, "help")) {
201 model_help("optimization", surf_optimization_mode_description);
205 /* New Module missing */
206 find_model_description(surf_optimization_mode_description, val);
209 /* callback of the cpu/model variable */
210 static void _sg_cfg_cb__storage_mode(const char *name, int pos)
214 xbt_assert(_sg_cfg_init_status < 2,
215 "Cannot change the model after the initialization");
217 val = xbt_cfg_get_string(_sg_cfg_set, name);
219 if (!strcmp(val, "help")) {
220 model_help("storage", surf_storage_model_description);
224 /* New Module missing */
225 find_model_description(surf_storage_model_description, val);
228 /* callback of the workstation_model variable */
229 static void _sg_cfg_cb__network_model(const char *name, int pos)
233 xbt_assert(_sg_cfg_init_status < 2,
234 "Cannot change the model after the initialization");
236 val = xbt_cfg_get_string(_sg_cfg_set, name);
238 if (!strcmp(val, "help")) {
239 model_help("network", surf_network_model_description);
243 /* New Module missing */
244 find_model_description(surf_network_model_description, val);
247 /* callbacks of the network models values */
248 static void _sg_cfg_cb__tcp_gamma(const char *name, int pos)
250 sg_tcp_gamma = xbt_cfg_get_double(_sg_cfg_set, name);
253 static void _sg_cfg_cb__maxmin_precision(const char* name, int pos)
255 sg_maxmin_precision = xbt_cfg_get_double(_sg_cfg_set, name);
258 static void _sg_cfg_cb__surf_precision(const char* name, int pos)
260 sg_surf_precision = xbt_cfg_get_double(_sg_cfg_set, name);
263 static void _sg_cfg_cb__sender_gap(const char* name, int pos)
265 sg_sender_gap = xbt_cfg_get_double(_sg_cfg_set, name);
268 static void _sg_cfg_cb__latency_factor(const char *name, int pos)
270 sg_latency_factor = xbt_cfg_get_double(_sg_cfg_set, name);
273 static void _sg_cfg_cb__bandwidth_factor(const char *name, int pos)
275 sg_bandwidth_factor = xbt_cfg_get_double(_sg_cfg_set, name);
278 static void _sg_cfg_cb__weight_S(const char *name, int pos)
280 sg_weight_S_parameter = xbt_cfg_get_double(_sg_cfg_set, name);
284 /* callback of the mpi collectives */
285 static void _sg_cfg_cb__coll(const char *category,
286 s_mpi_coll_description_t * table,
287 const char *name, int pos)
291 xbt_assert(_sg_cfg_init_status < 2,
292 "Cannot change the model after the initialization");
294 val = xbt_cfg_get_string(_sg_cfg_set, name);
296 if (!strcmp(val, "help")) {
297 coll_help(category, table);
301 /* New Module missing */
302 find_coll_description(table, val, category);
304 static void _sg_cfg_cb__coll_gather(const char *name, int pos){
305 _sg_cfg_cb__coll("gather", mpi_coll_gather_description, name, pos);
307 static void _sg_cfg_cb__coll_allgather(const char *name, int pos){
308 _sg_cfg_cb__coll("allgather", mpi_coll_allgather_description, name, pos);
310 static void _sg_cfg_cb__coll_allgatherv(const char *name, int pos){
311 _sg_cfg_cb__coll("allgatherv", mpi_coll_allgatherv_description, name, pos);
313 static void _sg_cfg_cb__coll_allreduce(const char *name, int pos)
315 _sg_cfg_cb__coll("allreduce", mpi_coll_allreduce_description, name, pos);
317 static void _sg_cfg_cb__coll_alltoall(const char *name, int pos)
319 _sg_cfg_cb__coll("alltoall", mpi_coll_alltoall_description, name, pos);
321 static void _sg_cfg_cb__coll_alltoallv(const char *name, int pos)
323 _sg_cfg_cb__coll("alltoallv", mpi_coll_alltoallv_description, name, pos);
325 static void _sg_cfg_cb__coll_bcast(const char *name, int pos)
327 _sg_cfg_cb__coll("bcast", mpi_coll_bcast_description, name, pos);
329 static void _sg_cfg_cb__coll_reduce(const char *name, int pos)
331 _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos);
333 static void _sg_cfg_cb__coll_reduce_scatter(const char *name, int pos){
334 _sg_cfg_cb__coll("reduce_scatter", mpi_coll_reduce_scatter_description, name, pos);
336 static void _sg_cfg_cb__coll_scatter(const char *name, int pos){
337 _sg_cfg_cb__coll("scatter", mpi_coll_scatter_description, name, pos);
339 static void _sg_cfg_cb__coll_barrier(const char *name, int pos){
340 _sg_cfg_cb__coll("barrier", mpi_coll_barrier_description, name, pos);
343 static void _sg_cfg_cb__wtime_sleep(const char *name, int pos){
344 smpi_wtime_sleep = xbt_cfg_get_double(_sg_cfg_set, name);
347 static void _sg_cfg_cb__iprobe_sleep(const char *name, int pos){
348 smpi_iprobe_sleep = xbt_cfg_get_double(_sg_cfg_set, name);
351 static void _sg_cfg_cb__test_sleep(const char *name, int pos){
352 smpi_test_sleep = xbt_cfg_get_double(_sg_cfg_set, name);
359 /* callback of the inclusion path */
360 static void _sg_cfg_cb__surf_path(const char *name, int pos)
362 char *path = xbt_cfg_get_string_at(_sg_cfg_set, name, pos);
363 xbt_dynar_push(surf_path, &path);
366 /* callback to decide if we want to use the model-checking */
367 #include "xbt_modinter.h"
370 extern int _sg_do_model_check; /* this variable lives in xbt_main until I find a right location for it */
371 extern int _sg_do_model_check_record;
374 static void _sg_cfg_cb_model_check_replay(const char *name, int pos)
376 MC_record_path = xbt_cfg_get_string(_sg_cfg_set, name);
379 static void _sg_cfg_cb_model_check(const char *name, int pos)
382 _sg_do_model_check = xbt_cfg_get_boolean(_sg_cfg_set, name);
384 if (xbt_cfg_get_boolean(_sg_cfg_set, name)) {
385 xbt_die("You tried to activate the model-checking from the command line, but it was not compiled in. Change your settings in cmake, recompile and try again");
390 static void _sg_cfg_cb_model_check_record(const char *name, int pos)
393 _sg_do_model_check_record = xbt_cfg_get_boolean(_sg_cfg_set, name);
395 if (xbt_cfg_get_boolean(_sg_cfg_set, name)) {
396 xbt_die("You tried to activate the model-checking record from the command line, but it was not compiled in. Change your settings in cmake, recompile and try again");
401 extern int _sg_do_verbose_exit;
403 static void _sg_cfg_cb_verbose_exit(const char *name, int pos)
405 _sg_do_verbose_exit = xbt_cfg_get_boolean(_sg_cfg_set, name);
408 extern int _sg_do_clean_atexit;
410 static void _sg_cfg_cb_clean_atexit(const char *name, int pos)
412 _sg_do_clean_atexit = xbt_cfg_get_boolean(_sg_cfg_set, name);
415 static void _sg_cfg_cb_context_factory(const char *name, int pos)
417 smx_context_factory_name = xbt_cfg_get_string(_sg_cfg_set, name);
420 static void _sg_cfg_cb_context_stack_size(const char *name, int pos)
422 smx_context_stack_size_was_set = 1;
423 smx_context_stack_size = xbt_cfg_get_int(_sg_cfg_set, name) * 1024;
426 static void _sg_cfg_cb_context_guard_size(const char *name, int pos)
428 smx_context_guard_size_was_set = 1;
429 smx_context_guard_size = xbt_cfg_get_int(_sg_cfg_set, name) * xbt_pagesize;
432 static void _sg_cfg_cb_contexts_nthreads(const char *name, int pos)
434 SIMIX_context_set_nthreads(xbt_cfg_get_int(_sg_cfg_set, name));
437 static void _sg_cfg_cb_contexts_parallel_threshold(const char *name, int pos)
439 SIMIX_context_set_parallel_threshold(xbt_cfg_get_int(_sg_cfg_set, name));
442 static void _sg_cfg_cb_contexts_parallel_mode(const char *name, int pos)
444 const char* mode_name = xbt_cfg_get_string(_sg_cfg_set, name);
445 if (!strcmp(mode_name, "posix")) {
446 SIMIX_context_set_parallel_mode(XBT_PARMAP_POSIX);
448 else if (!strcmp(mode_name, "futex")) {
449 SIMIX_context_set_parallel_mode(XBT_PARMAP_FUTEX);
451 else if (!strcmp(mode_name, "busy_wait")) {
452 SIMIX_context_set_parallel_mode(XBT_PARMAP_BUSY_WAIT);
455 xbt_die("Command line setting of the parallel synchronization mode should "
456 "be one of \"posix\", \"futex\" or \"busy_wait\"");
460 static void _sg_cfg_cb__surf_network_coordinates(const char *name,
463 int val = xbt_cfg_get_boolean(_sg_cfg_set, name);
465 if (!COORD_HOST_LEVEL) {
466 COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp);
467 COORD_ASR_LEVEL = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp);
470 if (COORD_HOST_LEVEL)
471 xbt_die("Setting of whether to use coordinate cannot be disabled once set.");
474 static void _sg_cfg_cb__surf_network_crosstraffic(const char *name,
477 sg_network_crosstraffic = xbt_cfg_get_boolean(_sg_cfg_set, name);
481 static void _sg_cfg_cb__gtnets_jitter(const char *name, int pos)
483 sg_gtnets_jitter = xbt_cfg_get_double(_sg_cfg_set, name);
486 static void _sg_cfg_cb__gtnets_jitter_seed(const char *name, int pos)
488 sg_gtnets_jitter_seed = xbt_cfg_get_int(_sg_cfg_set, name);
492 /* build description line with possible values */
493 static void describe_model(char *result,
494 const s_surf_model_description_t model_description[],
496 const char *description)
499 sprintf(result, "%s. Possible values: %s", description,
500 model_description[0].name ? model_description[0].name : "n/a");
502 for (i = 1; model_description[i].name; i++)
503 p += sprintf(p, ", %s", model_description[i].name);
505 ".\n (use 'help' as a value to see the long description of each %s)",
509 /* create the config set, register what should be and parse the command line*/
510 void sg_config_init(int *argc, char **argv)
512 char description[1024];
514 /* Create the configuration support */
515 if (_sg_cfg_init_status == 0) { /* Only create stuff if not already inited */
517 /* Plugins configuration */
518 describe_model(description, surf_plugin_description,
519 "plugin", "The plugins");
520 xbt_cfg_register(&_sg_cfg_set, "plugin", description,
521 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__plugin, NULL);
523 describe_model(description, surf_cpu_model_description,
524 "model", "The model to use for the CPU");
525 xbt_cfg_register(&_sg_cfg_set, "cpu/model", description,
526 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__cpu_model, NULL);
527 xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/model", "Cas01");
529 describe_model(description, surf_optimization_mode_description,
531 "The optimization modes to use for the CPU");
532 xbt_cfg_register(&_sg_cfg_set, "cpu/optim", description,
533 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
534 xbt_cfg_setdefault_string(_sg_cfg_set, "cpu/optim", "Lazy");
536 describe_model(description, surf_storage_model_description,
537 "model", "The model to use for the storage");
538 xbt_cfg_register(&_sg_cfg_set, "storage/model", description,
539 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__storage_mode, NULL);
540 xbt_cfg_setdefault_string(_sg_cfg_set, "storage/model", "default");
542 describe_model(description, surf_network_model_description,
543 "model", "The model to use for the network");
544 xbt_cfg_register(&_sg_cfg_set, "network/model", description,
545 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__network_model, NULL);
546 xbt_cfg_setdefault_string(_sg_cfg_set, "network/model", "LV08");
548 describe_model(description, surf_optimization_mode_description,
550 "The optimization modes to use for the network");
551 xbt_cfg_register(&_sg_cfg_set, "network/optim", description,
552 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__optimization_mode, NULL);
553 xbt_cfg_setdefault_string(_sg_cfg_set, "network/optim", "Lazy");
555 describe_model(description, surf_workstation_model_description,
556 "model", "The model to use for the workstation");
557 xbt_cfg_register(&_sg_cfg_set, "workstation/model", description,
558 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__workstation_model, NULL);
559 xbt_cfg_setdefault_string(_sg_cfg_set, "workstation/model", "default");
561 describe_model(description, surf_vm_workstation_model_description,
562 "model", "The model to use for the vm workstation");
563 xbt_cfg_register(&_sg_cfg_set, "vm_workstation/model", description,
564 xbt_cfgelm_string, 1, 1, &_sg_cfg_cb__vm_workstation_model, NULL);
565 xbt_cfg_setdefault_string(_sg_cfg_set, "vm_workstation/model", "default");
567 xbt_cfg_register(&_sg_cfg_set, "network/TCP_gamma",
568 "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; Use the last given value, which is the max window size)",
569 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__tcp_gamma, NULL);
570 xbt_cfg_setdefault_double(_sg_cfg_set, "network/TCP_gamma", 4194304.0);
572 xbt_cfg_register(&_sg_cfg_set, "surf/precision",
573 "Numerical precision used when updating simulation times (hence this value is expressed in seconds)",
574 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__surf_precision, NULL);
575 xbt_cfg_setdefault_double(_sg_cfg_set, "surf/precision", 0.00001);
577 xbt_cfg_register(&_sg_cfg_set, "maxmin/precision",
578 "Numerical precision used when computing resource sharing (hence this value is expressed in ops/sec or bytes/sec)",
579 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__maxmin_precision, NULL);
580 xbt_cfg_setdefault_double(_sg_cfg_set, "maxmin/precision", 0.00001);
582 /* The parameters of network models */
584 xbt_cfg_register(&_sg_cfg_set, "network/sender_gap",
585 "Minimum gap between two overlapping sends",
586 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__sender_gap, NULL);
587 /* real default for "network/sender_gap" is set in network_smpi.cpp */
588 xbt_cfg_setdefault_double(_sg_cfg_set, "network/sender_gap", NAN);
590 xbt_cfg_register(&_sg_cfg_set, "network/latency_factor",
591 "Correction factor to apply to the provided latency (default value set by network model)",
592 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__latency_factor, NULL);
593 xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
595 xbt_cfg_register(&_sg_cfg_set, "network/bandwidth_factor",
596 "Correction factor to apply to the provided bandwidth (default value set by network model)",
597 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__bandwidth_factor, NULL);
598 xbt_cfg_setdefault_double(_sg_cfg_set, "network/bandwidth_factor", 1.0);
600 xbt_cfg_register(&_sg_cfg_set, "network/weight_S",
601 "Correction factor to apply to the weight of competing streams (default value set by network model)",
602 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__weight_S, NULL);
603 /* real default for "network/weight_S" is set in network_*.cpp */
604 xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", NAN);
607 xbt_cfg_register(&_sg_cfg_set, "path",
608 "Lookup path for inclusions in platform and deployment XML files",
609 xbt_cfgelm_string, 1, 0, _sg_cfg_cb__surf_path, NULL);
611 xbt_cfg_register(&_sg_cfg_set, "cpu/maxmin_selective_update",
612 "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)",
613 xbt_cfgelm_boolean, 1, 1, NULL, NULL);
614 xbt_cfg_setdefault_boolean(_sg_cfg_set, "cpu/maxmin_selective_update", "no");
616 xbt_cfg_register(&_sg_cfg_set, "network/maxmin_selective_update",
617 "Update the constraint set propagating recursively to others constraints (off by default when optim is set to lazy)",
618 xbt_cfgelm_boolean, 1, 1, NULL, NULL);
619 xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/maxmin_selective_update", "no");
621 /* Replay (this part is enabled event if MC it disabled) */
622 xbt_cfg_register(&_sg_cfg_set, "model-check/replay",
623 "Uenable replay mode with the given path",
624 xbt_cfgelm_string, 0, 1, _sg_cfg_cb_model_check_replay, NULL);
627 /* do model-checking */
628 xbt_cfg_register(&_sg_cfg_set, "model-check",
629 "Verify the system through model-checking instead of simulating it (EXPERIMENTAL)",
630 xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb_model_check, NULL);
631 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check", "no");
633 /* do model-checking-record */
634 xbt_cfg_register(&_sg_cfg_set, "model-check/record",
635 "Record the model-checking paths",
636 xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb_model_check_record, NULL);
637 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/record", "no");
639 /* do stateful model-checking */
640 xbt_cfg_register(&_sg_cfg_set, "model-check/checkpoint",
641 "Specify the amount of steps between checkpoints during stateful model-checking (default: 0 => stateless verification). "
642 "If value=1, one checkpoint is saved for each step => faster verification, but huge memory consumption; higher values are good compromises between speed and memory consumption.",
643 xbt_cfgelm_int, 1, 1, _mc_cfg_cb_checkpoint, NULL);
644 xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/checkpoint", 0);
646 /* do stateful model-checking */
647 xbt_cfg_register(&_sg_cfg_set, "model-check/sparse-checkpoint",
648 "Use sparse per-page snapshots.",
649 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_sparse_checkpoint, NULL);
650 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/sparse-checkpoint", "no");
652 /* do stateful model-checking */
653 xbt_cfg_register(&_sg_cfg_set, "model-check/soft-dirty",
654 "Use sparse per-page snapshots.",
655 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_soft_dirty, NULL);
656 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/soft-dirty", "no");
658 /* do liveness model-checking */
659 xbt_cfg_register(&_sg_cfg_set, "model-check/property",
660 "Specify the name of the file containing the property. It must be the result of the ltl2ba program.",
661 xbt_cfgelm_string, 1, 1, _mc_cfg_cb_property, NULL);
662 xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/property", "");
664 /* do communications determinism model-checking */
665 xbt_cfg_register(&_sg_cfg_set, "model-check/communications_determinism",
666 "Enable/disable the detection of determinism in the communications schemes",
667 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_comms_determinism, NULL);
668 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/communications_determinism", "no");
670 /* do send determinism model-checking */
671 xbt_cfg_register(&_sg_cfg_set, "model-check/send_determinism",
672 "Enable/disable the detection of send-determinism in the communications schemes",
673 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_send_determinism, NULL);
674 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/send_determinism", "no");
676 /* Specify the kind of model-checking reduction */
677 xbt_cfg_register(&_sg_cfg_set, "model-check/reduction",
678 "Specify the kind of exploration reduction (either none or DPOR)",
679 xbt_cfgelm_string, 1, 1, _mc_cfg_cb_reduce, NULL);
680 xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/reduction", "dpor");
682 /* Enable/disable timeout for wait requests with model-checking */
683 xbt_cfg_register(&_sg_cfg_set, "model-check/timeout",
684 "Enable/Disable timeout for wait requests",
685 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_timeout, NULL);
686 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/timeout", "no");
688 /* Enable/disable global hash computation with model-checking */
689 xbt_cfg_register(&_sg_cfg_set, "model-check/hash",
690 "Enable/Disable state hash for state comparison (exprimental)",
691 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_hash, NULL);
692 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/hash", "no");
694 /* Set max depth exploration */
695 xbt_cfg_register(&_sg_cfg_set, "model-check/snapshot_fds",
696 "Whether file descriptors must be snapshoted",
697 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_snapshot_fds, NULL);
698 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/snapshot_fds", "no");
700 /* Set max depth exploration */
701 xbt_cfg_register(&_sg_cfg_set, "model-check/max_depth",
702 "Specify the max depth of exploration (default : 1000)",
703 xbt_cfgelm_int, 1, 1, _mc_cfg_cb_max_depth, NULL);
704 xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/max_depth", 1000);
706 /* Set number of visited state stored for state comparison reduction*/
707 xbt_cfg_register(&_sg_cfg_set, "model-check/visited",
708 "Specify the number of visited state stored for state comparison reduction. If value=5, the last 5 visited states are stored",
709 xbt_cfgelm_int, 1, 1, _mc_cfg_cb_visited, NULL);
710 xbt_cfg_setdefault_int(_sg_cfg_set, "model-check/visited", 0);
712 /* Set file name for dot output of graph state */
713 xbt_cfg_register(&_sg_cfg_set, "model-check/dot_output",
714 "Specify the name of dot file corresponding to graph state",
715 xbt_cfgelm_string, 1, 1, _mc_cfg_cb_dot_output, NULL);
716 xbt_cfg_setdefault_string(_sg_cfg_set, "model-check/dot_output", "");
718 /* Enable/disable non progressive cycles detection with model-checking */
719 xbt_cfg_register(&_sg_cfg_set, "model-check/termination",
720 "Enable/Disable non progressive cycle detection",
721 xbt_cfgelm_boolean, 1, 1, _mc_cfg_cb_termination, NULL);
722 xbt_cfg_setdefault_boolean(_sg_cfg_set, "model-check/termination", "no");
725 /* do verbose-exit */
726 xbt_cfg_register(&_sg_cfg_set, "verbose-exit",
727 "Activate the \"do nothing\" mode in Ctrl-C",
728 xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb_verbose_exit, NULL);
729 xbt_cfg_setdefault_boolean(_sg_cfg_set, "verbose-exit", "yes");
731 /* context factory */
732 const char *dflt_ctx_fact = "thread";
734 char *p = description +
736 "Context factory to use in SIMIX. Possible values: %s",
738 #ifdef CONTEXT_UCONTEXT
739 dflt_ctx_fact = "ucontext";
740 p += sprintf(p, ", %s", dflt_ctx_fact);
743 dflt_ctx_fact = "raw";
744 p += sprintf(p, ", %s", dflt_ctx_fact);
748 xbt_cfg_register(&_sg_cfg_set, "contexts/factory", description,
749 xbt_cfgelm_string, 1, 1, _sg_cfg_cb_context_factory, NULL);
750 xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", dflt_ctx_fact);
752 /* stack size of contexts in KiB */
753 xbt_cfg_register(&_sg_cfg_set, "contexts/stack_size",
754 "Stack size of contexts in KiB",
755 xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_stack_size, NULL);
756 xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/stack_size", 8*1024);
757 /* No, it was not set yet (the above setdefault() changed this to 1). */
758 smx_context_stack_size_was_set = 0;
760 /* guard size for contexts stacks in memory pages */
761 xbt_cfg_register(&_sg_cfg_set, "contexts/guard_size",
762 "Guard size for contexts stacks in memory pages",
763 xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_guard_size, NULL);
764 #if defined(_XBT_WIN32) || (PTH_STACKGROWTH != -1)
765 xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 0);
767 xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/guard_size", 1);
769 /* No, it was not set yet (the above setdefault() changed this to 1). */
770 smx_context_guard_size_was_set = 0;
772 /* number of parallel threads for user processes */
773 xbt_cfg_register(&_sg_cfg_set, "contexts/nthreads",
774 "Number of parallel threads used to execute user contexts",
775 xbt_cfgelm_int, 1, 1, _sg_cfg_cb_contexts_nthreads, NULL);
776 xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/nthreads", 1);
778 /* minimal number of user contexts to be run in parallel */
779 xbt_cfg_register(&_sg_cfg_set, "contexts/parallel_threshold",
780 "Minimal number of user contexts to be run in parallel (raw contexts only)",
781 xbt_cfgelm_int, 1, 1, _sg_cfg_cb_contexts_parallel_threshold, NULL);
782 xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/parallel_threshold", 2);
784 /* synchronization mode for parallel user contexts */
785 xbt_cfg_register(&_sg_cfg_set, "contexts/synchro",
786 "Synchronization mode to use when running contexts in parallel (either futex, posix or busy_wait)",
787 xbt_cfgelm_string, 1, 1, _sg_cfg_cb_contexts_parallel_mode, NULL);
789 xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/synchro", "futex");
790 #else //No futex on mac and posix is unimplememted yet
791 xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/synchro", "busy_wait");
794 xbt_cfg_register(&_sg_cfg_set, "network/coordinates",
795 "\"yes\" or \"no\", specifying whether we use a coordinate-based routing (as Vivaldi)",
796 xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb__surf_network_coordinates, NULL);
797 xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/coordinates", "no");
799 xbt_cfg_register(&_sg_cfg_set, "network/crosstraffic",
800 "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM02)",
801 xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb__surf_network_crosstraffic, NULL);
802 xbt_cfg_setdefault_boolean(_sg_cfg_set, "network/crosstraffic", "no");
805 xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter",
806 "Double value to oscillate the link latency, uniformly in random interval [-latency*gtnets_jitter,latency*gtnets_jitter)",
807 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__gtnets_jitter, NULL);
808 xbt_cfg_setdefault_double(_sg_cfg_set, "gtnets/jitter", 0.0);
810 xbt_cfg_register(&_sg_cfg_set, "gtnets/jitter_seed",
811 "Use a positive seed to reproduce jitted results, value must be in [1,1e8], default is 10",
812 xbt_cfgelm_int, 0, 1, _sg_cfg_cb__gtnets_jitter_seed, NULL);
813 xbt_cfg_setdefault_int(_sg_cfg_set, "gtnets/jitter_seed", 10);
816 xbt_cfg_register(&_sg_cfg_set, "ns3/TcpModel",
817 "The ns3 tcp model can be : NewReno or Reno or Tahoe",
818 xbt_cfgelm_string, 1, 1, NULL, NULL);
819 xbt_cfg_setdefault_string(_sg_cfg_set, "ns3/TcpModel", "default");
822 //For smpi/bw_factor and smpi/lat_factor
823 //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
824 //test is if( size >= thresholdN ) return valueN;
825 //Values can be modified with command line --cfg=smpi/bw_factor:"threshold0:value0;threshold1:value1;...;thresholdN:valueN"
826 // or with tag config put line <prop id="smpi/bw_factor" value="threshold0:value0;threshold1:value1;...;thresholdN:valueN"></prop>
827 // SMPI model can be used without enable_smpi, so keep this the ifdef.
828 xbt_cfg_register(&_sg_cfg_set, "smpi/bw_factor",
829 "Bandwidth factors for smpi.",
830 xbt_cfgelm_string, 1, 1, NULL, NULL);
831 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/bw_factor", "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");
833 xbt_cfg_register(&_sg_cfg_set, "smpi/lat_factor",
834 "Latency factors for smpi.",
835 xbt_cfgelm_string, 1, 1, NULL, NULL);
836 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/lat_factor", "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");
838 xbt_cfg_register(&_sg_cfg_set, "smpi/IB_penalty_factors",
839 "Correction factor to communications using Infiniband model with contention (default value based on Stampede cluster profiling)",
840 xbt_cfgelm_string, 1, 1, NULL, NULL);
841 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/IB_penalty_factors", "0.965;0.925;1.35");
844 xbt_cfg_register(&_sg_cfg_set, "smpi/running_power",
845 "Power of the host running the simulation (in flop/s). Used to bench the operations.",
846 xbt_cfgelm_double, 1, 1, NULL, NULL);
847 xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/running_power", 20000.0);
849 xbt_cfg_register(&_sg_cfg_set, "smpi/display_timing",
850 "Boolean indicating whether we should display the timing after simulation.",
851 xbt_cfgelm_boolean, 1, 1, NULL, NULL);
852 xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/display_timing", "no");
854 xbt_cfg_register(&_sg_cfg_set, "smpi/simulate_computation",
855 "Boolean indicating whether the computational part of the simulated application should be simulated.",
856 xbt_cfgelm_boolean, 1, 1, NULL, NULL);
857 xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/simulate_computation", "yes");
859 xbt_cfg_register(&_sg_cfg_set, "smpi/use_shared_malloc",
860 "Boolean indicating whether we should use shared memory when using SMPI_SHARED_MALLOC. Allows user to disable it for debug purposes.",
861 xbt_cfgelm_boolean, 1, 1, NULL, NULL);
862 xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/use_shared_malloc", "yes");
864 xbt_cfg_register(&_sg_cfg_set, "smpi/cpu_threshold",
865 "Minimal computation time (in seconds) not discarded, or -1 for infinity.",
866 xbt_cfgelm_double, 1, 1, NULL, NULL);
867 xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/cpu_threshold", 1e-6);
869 xbt_cfg_register(&_sg_cfg_set, "smpi/async_small_thres",
870 "Maximal size of messages that are to be sent asynchronously, without waiting for the receiver",
871 xbt_cfgelm_int, 1, 1, NULL, NULL);
872 xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/async_small_thres", 0);
874 xbt_cfg_register(&_sg_cfg_set, "smpi/send_is_detached_thres",
875 "Threshold of message size where MPI_Send stops behaving like MPI_Isend and becomes MPI_Ssend",
876 xbt_cfgelm_int, 1, 1, NULL, NULL);
877 xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thres", 65536);
879 xbt_cfg_register(&_sg_cfg_set, "smpi/privatize_global_variables",
880 "Boolean indicating whether we should privatize global variable at runtime.",
881 xbt_cfgelm_boolean, 1, 1, NULL, NULL);
882 xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/privatize_global_variables", "no");
884 xbt_cfg_register(&_sg_cfg_set, "smpi/os",
885 "Small messages timings (MPI_Send minimum time for small messages)",
886 xbt_cfgelm_string, 1, 1, NULL, NULL);
887 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/os", "1:0:0:0:0");
889 xbt_cfg_register(&_sg_cfg_set, "smpi/ois",
890 "Small messages timings (MPI_Isend minimum time for small messages)",
891 xbt_cfgelm_string, 1, 1, NULL, NULL);
892 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/ois", "1:0:0:0:0");
894 xbt_cfg_register(&_sg_cfg_set, "smpi/or",
895 "Small messages timings (MPI_Recv minimum time for small messages)",
896 xbt_cfgelm_string, 1, 1, NULL, NULL);
897 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/or", "1:0:0:0:0");
899 xbt_cfg_register(&_sg_cfg_set, "smpi/iprobe",
900 "Minimum time to inject inside a call to MPI_Iprobe",
901 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__iprobe_sleep, NULL);
902 xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/iprobe", 1e-4);
904 xbt_cfg_register(&_sg_cfg_set, "smpi/test",
905 "Minimum time to inject inside a call to MPI_Test",
906 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__test_sleep, NULL);
907 xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/test", 1e-4);
909 xbt_cfg_register(&_sg_cfg_set, "smpi/wtime",
910 "Minimum time to inject inside a call to MPI_Wtime",
911 xbt_cfgelm_double, 1, 1, _sg_cfg_cb__wtime_sleep, NULL);
912 xbt_cfg_setdefault_double(_sg_cfg_set, "smpi/wtime", 0.0);
914 xbt_cfg_register(&_sg_cfg_set, "smpi/coll_selector",
915 "Which collective selector to use",
916 xbt_cfgelm_string, 1, 1, NULL, NULL);
917 xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/coll_selector", "default");
919 xbt_cfg_register(&_sg_cfg_set, "smpi/gather",
920 "Which collective to use for gather",
921 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_gather, NULL);
923 xbt_cfg_register(&_sg_cfg_set, "smpi/allgather",
924 "Which collective to use for allgather",
925 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_allgather, NULL);
927 xbt_cfg_register(&_sg_cfg_set, "smpi/barrier",
928 "Which collective to use for barrier",
929 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_barrier, NULL);
931 xbt_cfg_register(&_sg_cfg_set, "smpi/reduce_scatter",
932 "Which collective to use for reduce_scatter",
933 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_reduce_scatter, NULL);
935 xbt_cfg_register(&_sg_cfg_set, "smpi/scatter",
936 "Which collective to use for scatter",
937 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_scatter, NULL);
939 xbt_cfg_register(&_sg_cfg_set, "smpi/allgatherv",
940 "Which collective to use for allgatherv",
941 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_allgatherv, NULL);
943 xbt_cfg_register(&_sg_cfg_set, "smpi/allreduce",
944 "Which collective to use for allreduce",
945 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_allreduce, NULL);
947 xbt_cfg_register(&_sg_cfg_set, "smpi/alltoall",
948 "Which collective to use for alltoall",
949 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_alltoall, NULL);
951 xbt_cfg_register(&_sg_cfg_set, "smpi/alltoallv",
952 "Which collective to use for alltoallv",
953 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_alltoallv, NULL);
955 xbt_cfg_register(&_sg_cfg_set, "smpi/bcast",
956 "Which collective to use for bcast",
957 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_bcast, NULL);
959 xbt_cfg_register(&_sg_cfg_set, "smpi/reduce",
960 "Which collective to use for reduce",
961 xbt_cfgelm_string, 0, 1, &_sg_cfg_cb__coll_reduce, NULL);
964 xbt_cfg_register(&_sg_cfg_set, "clean_atexit",
965 "\"yes\" or \"no\". \"yes\" enables all the cleanups of SimGrid (XBT,SIMIX,MSG) to be registered with atexit. \"no\" may be useful if your code segfaults when calling the exit function.",
966 xbt_cfgelm_boolean, 1, 1, _sg_cfg_cb_clean_atexit, NULL);
967 xbt_cfg_setdefault_boolean(_sg_cfg_set, "clean_atexit", "yes");
970 /* retrieves the current directory of the current process */
971 const char *initial_path = __surf_get_initial_path();
972 xbt_assert((initial_path),
973 "__surf_get_initial_path() failed! Can't resolves current Windows directory");
975 surf_path = xbt_dynar_new(sizeof(char *), NULL);
976 xbt_cfg_setdefault_string(_sg_cfg_set, "path", initial_path);
979 xbt_cfg_check(_sg_cfg_set);
980 _sg_cfg_init_status = 1;
982 sg_config_cmd_line(argc, argv);
984 xbt_mallocator_initialization_is_done(SIMIX_context_is_parallel());
987 XBT_WARN("Call to sg_config_init() after initialization ignored");
991 void sg_config_finalize(void)
993 if (!_sg_cfg_init_status)
994 return; /* Not initialized yet. Nothing to do */
996 xbt_cfg_free(&_sg_cfg_set);
997 _sg_cfg_init_status = 0;
1000 /* Pick the right models for CPU, net and workstation, and call their model_init_preparse */
1001 void surf_config_models_setup()
1003 const char *workstation_model_name;
1004 const char *vm_workstation_model_name;
1005 int workstation_id = -1;
1006 int vm_workstation_id = -1;
1007 char *network_model_name = NULL;
1008 char *cpu_model_name = NULL;
1009 int storage_id = -1;
1010 char *storage_model_name = NULL;
1012 workstation_model_name =
1013 xbt_cfg_get_string(_sg_cfg_set, "workstation/model");
1014 vm_workstation_model_name =
1015 xbt_cfg_get_string(_sg_cfg_set, "vm_workstation/model");
1016 network_model_name = xbt_cfg_get_string(_sg_cfg_set, "network/model");
1017 cpu_model_name = xbt_cfg_get_string(_sg_cfg_set, "cpu/model");
1018 storage_model_name = xbt_cfg_get_string(_sg_cfg_set, "storage/model");
1020 /* Check whether we use a net/cpu model differing from the default ones, in which case
1021 * we should switch to the "compound" workstation model to correctly dispatch stuff to
1022 * the right net/cpu models.
1025 if ((!xbt_cfg_is_default_value(_sg_cfg_set, "network/model") ||
1026 !xbt_cfg_is_default_value(_sg_cfg_set, "cpu/model")) &&
1027 xbt_cfg_is_default_value(_sg_cfg_set, "workstation/model")) {
1028 XBT_INFO("Switching workstation model to compound since you changed the network and/or cpu model(s)");
1029 workstation_model_name = "compound";
1030 xbt_cfg_set_string(_sg_cfg_set, "workstation/model", workstation_model_name);
1033 XBT_DEBUG("Workstation model: %s", workstation_model_name);
1035 find_model_description(surf_workstation_model_description,
1036 workstation_model_name);
1037 if (!strcmp(workstation_model_name, "compound")) {
1038 int network_id = -1;
1041 xbt_assert(cpu_model_name,
1042 "Set a cpu model to use with the 'compound' workstation model");
1044 xbt_assert(network_model_name,
1045 "Set a network model to use with the 'compound' workstation model");
1047 if(surf_cpu_model_init_preparse){
1048 surf_cpu_model_init_preparse();
1051 find_model_description(surf_cpu_model_description, cpu_model_name);
1052 surf_cpu_model_description[cpu_id].model_init_preparse();
1056 find_model_description(surf_network_model_description,
1057 network_model_name);
1058 surf_network_model_description[network_id].model_init_preparse();
1061 XBT_DEBUG("Call workstation_model_init");
1062 surf_workstation_model_description[workstation_id].model_init_preparse();
1064 XBT_DEBUG("Call vm_workstation_model_init");
1065 vm_workstation_id = find_model_description(surf_vm_workstation_model_description,
1066 vm_workstation_model_name);
1067 surf_vm_workstation_model_description[vm_workstation_id].model_init_preparse();
1069 XBT_DEBUG("Call storage_model_init");
1070 storage_id = find_model_description(surf_storage_model_description, storage_model_name);
1071 surf_storage_model_description[storage_id].model_init_preparse();
1075 int sg_cfg_is_default_value(const char *name)
1077 return xbt_cfg_is_default_value(_sg_cfg_set, name);
1080 int sg_cfg_get_int(const char* name)
1082 return xbt_cfg_get_int(_sg_cfg_set, name);
1085 double sg_cfg_get_double(const char* name)
1087 return xbt_cfg_get_double(_sg_cfg_set, name);
1090 char* sg_cfg_get_string(const char* name)
1092 return xbt_cfg_get_string(_sg_cfg_set, name);
1095 int sg_cfg_get_boolean(const char* name)
1097 return xbt_cfg_get_boolean(_sg_cfg_set, name);
1100 void sg_cfg_get_peer(const char *name, char **peer, int *port)
1102 xbt_cfg_get_peer(_sg_cfg_set, name, peer, port);
1105 xbt_dynar_t sg_cfg_get_dynar(const char* name)
1107 return xbt_cfg_get_dynar(_sg_cfg_set, name);