option. For example, ``--cfg=plugin:help`` will give you the list
of plugins available in your installation of SimGrid.
-- **clean-atexit:** :ref:`cfg=clean-atexit`
-
- **contexts/factory:** :ref:`cfg=contexts/factory`
- **contexts/guard-size:** :ref:`cfg=contexts/guard-size`
- **contexts/nthreads:** :ref:`cfg=contexts/nthreads`
- **cpu/model:** :ref:`options_model_select`
- **cpu/optim:** :ref:`Cpu Optimization Level <options_model_optim>`
+- **debug/breakpoint:** :ref:`cfg=debug/breakpoint`
+- **debug/clean-atexit:** :ref:`cfg=debug/clean-atexit`
+- **debug/verbose-exit:** :ref:`cfg=debug/verbose-exit`
+
- **exception/cutpath:** :ref:`cfg=exception/cutpath`
- **host/model:** :ref:`options_model_select`
- **path:** :ref:`cfg=path`
- **plugin:** :ref:`cfg=plugin`
-- **simix/breakpoint:** :ref:`cfg=simix/breakpoint`
-
- **storage/max_file_descriptors:** :ref:`cfg=storage/max_file_descriptors`
- **surf/precision:** :ref:`cfg=surf/precision`
- **Tracing configuration options** can be found in Section :ref:`tracing_tracing_options`
- **storage/model:** :ref:`options_model_select`
-- **verbose-exit:** :ref:`cfg=verbose-exit`
- **vm/model:** :ref:`options_model_select`
Other Configurations
--------------------
-.. _cfg=clean-atexit:
+.. _cfg=debug/clean-atexit:
Cleanup at Termination
......................
-**Option** ``clean-atexit`` **default:** on
+**Option** ``debug/clean-atexit`` **default:** on
If your code is segfaulting during its finalization, it may help to
disable this option to request SimGrid to not attempt any cleanups at
item. To add several directory to the path, set the configuration
item several times, as in ``--cfg=path:toto --cfg=path:tutu``
-.. _cfg=simix/breakpoint:
+.. _cfg=debug/breakpoint:
Set a Breakpoint
................
-**Option** ``simix/breakpoint`` **default:** unset
+**Option** ``debug/breakpoint`` **default:** unset
This configuration option sets a breakpoint: when the simulated clock
reaches the given time, a SIGTRAP is raised. This can be used to stop
set variable simgrid::simix::breakpoint = 3.1416
-.. _cfg=verbose-exit:
+.. _cfg=debug/verbose-exit:
Behavior on Ctrl-C
..................
-**Option** ``verbose-exit`` **default:** on
+**Option** ``debug/verbose-exit`` **default:** on
By default, when Ctrl-C is pressed, the status of all existing actors
is displayed before exiting the simulation. This is very useful to
#!/usr/bin/env tesh
-p Testing option --cfg=simix/breakpoint
+p Testing option --cfg=debug/breakpoint
! expect signal SIGTRAP
-$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=simix/breakpoint:3.1416
-> [ 0.000000] (0:maestro@) Configuration change: Set 'simix/breakpoint' to '3.1416'
+$ ${bindir:=.}/s4u-app-pingpong ${platfdir}/small_platform.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n" --cfg=debug/breakpoint:3.1416
+> [ 0.000000] (0:maestro@) Configuration change: Set 'debug/breakpoint' to '3.1416'
> [ 0.000000] (1:pinger@Tremblay) Ping from mailbox Mailbox 1 to mailbox Mailbox 2
> [ 0.000000] (2:ponger@Jupiter) Pong from mailbox Mailbox 2 to mailbox Mailbox 1
> [ 0.019014] (2:ponger@Jupiter) Task received : small communication (latency bound)
MC_ignore_heap(&(msg_global->sent_msg), sizeof(msg_global->sent_msg));
}
- if (simgrid::config::get_value<bool>("clean-atexit"))
+ if (simgrid::config::get_value<bool>("debug/clean-atexit"))
atexit(MSG_exit);
}
sd_global = new simgrid::sd::Global();
simgrid::config::set_default<std::string>("host/model", "ptask_L07");
- if (simgrid::config::get_value<bool>("clean-atexit"))
+ if (simgrid::config::get_value<bool>("debug/clean-atexit"))
atexit(SD_exit);
}
"no");
simgrid::config::alias("network/maxmin-selective-update", {"network/maxmin_selective_update"});
- extern bool _sg_do_verbose_exit;
- simgrid::config::bind_flag(_sg_do_verbose_exit, "verbose-exit", "Activate the \"do nothing\" mode in Ctrl-C");
-
simgrid::config::declare_flag<int>("contexts/stack-size", "Stack size of contexts in KiB (not with threads)",
8 * 1024, [](int value) { smx_context_stack_size = value * 1024; });
simgrid::config::alias("contexts/stack-size", {"contexts/stack_size"});
simgrid::config::declare_flag<bool>(
"exception/cutpath", "Whether to cut all path information from call traces, used e.g. in exceptions.", false);
- extern bool _sg_do_clean_atexit;
- simgrid::config::bind_flag(_sg_do_clean_atexit, "clean-atexit", {"clean_atexit"},
- "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end.");
-
if (surf_path.empty())
simgrid::config::set_default<std::string>("path", "./");
void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr) = nullptr;
-bool _sg_do_verbose_exit = true;
+namespace simgrid {
+namespace simix {
+simgrid::config::Flag<double> cfg_verbose_exit{
+ "debug/verbose-exit", {"verbose-exit"}, "Display the actor status at exit", true};
+}
+} // namespace simgrid
XBT_ATTRIB_NORETURN static void inthandler(int)
{
- if ( _sg_do_verbose_exit ) {
- XBT_INFO("CTRL-C pressed. The current status will be displayed before exit (disable that behavior with option 'verbose-exit').");
- SIMIX_display_process_status();
+ if (simgrid::simix::cfg_verbose_exit) {
+ XBT_INFO("CTRL-C pressed. The current status will be displayed before exit (disable that behavior with option "
+ "'debug/verbose-exit').");
+ SIMIX_display_process_status();
}
else {
- XBT_INFO("CTRL-C pressed, exiting. Hiding the current process status since 'verbose-exit' is set to false.");
+ XBT_INFO("CTRL-C pressed, exiting. Hiding the current process status since 'debug/verbose-exit' is set to false.");
}
exit(1);
}
actors_to_run.clear();
}
-simgrid::config::Flag<double> breakpoint{"simix/breakpoint",
- "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
+simgrid::config::Flag<double> cfg_breakpoint{
+ "debug/breakpoint", {"simix/breakpoint"}, "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
}
}
});
}
- if (simgrid::config::get_value<bool>("clean-atexit"))
+ if (simgrid::config::get_value<bool>("debug/clean-atexit"))
atexit(SIMIX_clean);
}
do {
XBT_DEBUG("New Schedule Round; size(queue)=%zu", simix_global->actors_to_run.size());
- if (simgrid::simix::breakpoint >= 0.0 && surf_get_clock() >= simgrid::simix::breakpoint) {
- XBT_DEBUG("Breakpoint reached (%g)", simgrid::simix::breakpoint.get());
- simgrid::simix::breakpoint = -1.0;
+ if (simgrid::simix::cfg_breakpoint >= 0.0 && surf_get_clock() >= simgrid::simix::cfg_breakpoint) {
+ XBT_DEBUG("Breakpoint reached (%g)", simgrid::simix::cfg_breakpoint.get());
+ simgrid::simix::cfg_breakpoint = -1.0;
#ifdef SIGTRAP
std::raise(SIGTRAP);
#else
xbt_dynar_t xbt_cmdline = NULL; /* all we got in argv */
int xbt_initialized = 0;
-bool _sg_do_clean_atexit = true;
+simgrid::config::Flag<bool> cfg_dbg_clean_atexit{
+ "debug/clean-atexit",
+ {"clean-atexit"},
+ "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end.",
+ true};
int xbt_pagesize;
int xbt_pagebits = 0;
static void xbt_postexit()
{
- if (not _sg_do_clean_atexit)
+ if (not cfg_dbg_clean_atexit)
return;
xbt_initialized--;
xbt_dict_postexit();