void (*SMPI_switch_data_segment)(simgrid::s4u::ActorPtr) = nullptr;
-bool _sg_do_verbose_exit = true;
-static void inthandler(int)
+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);
}
intrusive_ptr_release(actor);
}
#if SIMGRID_HAVE_MC
- xbt_dynar_reset(simix_global->dead_actors_vector);
+ xbt_dynar_reset(dead_actors_vector);
#endif
}
/**
- * @brief Executes the actors in simix_global->actors_to_run.
+ * @brief Executes the actors in actors_to_run.
*
- * The actors in simix_global->actors_to_run are run (in parallel if possible). On exit, simix_global->actors_to_run
- * is empty, and simix_global->actors_that_ran contains the list of actors that just ran.
- * The two lists are swapped so, be careful when using them before and after a call to this function.
+ * The actors in actors_to_run are run (in parallel if possible). On exit, actors_to_run is empty, and actors_that_ran
+ * contains the list of actors that just ran. The two lists are swapped so, be careful when using them before and after
+ * a call to this function.
*/
void Global::run_all_actors()
{
SIMIX_context_runall();
- simix_global->actors_to_run.swap(simix_global->actors_that_ran);
- simix_global->actors_to_run.clear();
+ actors_to_run.swap(actors_that_ran);
+ 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);
}
// FIXME: make the timers being real callbacks (i.e. provide dispatchers that read and expand the args)
smx_timer_t timer = simgrid::simix::simix_timers.top().second;
simgrid::simix::simix_timers.pop();
- try {
- timer->callback();
- } catch (...) {
- xbt_die("Exception thrown ouf of timer callback");
- }
+ timer->callback();
delete timer;
}
return result;
*/
void SIMIX_run()
{
- if (not MC_record_path.empty()) {
+ if (MC_record_replay_is_active()) {
simgrid::mc::replay(MC_record_path);
return;
}
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