X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8e9f8a24a8008be80ab9e30a25c4e89ec6347052..7cbb44e02a4c28ea278e9b82c9dda3bdff2c3cb9:/src/simix/smx_global.cpp diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 461b844559..9510c955fd 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -32,15 +32,21 @@ std::unique_ptr simix_global; 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 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); } @@ -187,8 +193,8 @@ void Global::run_all_actors() actors_to_run.clear(); } -simgrid::config::Flag breakpoint{"simix/breakpoint", - "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0}; +simgrid::config::Flag cfg_breakpoint{ + "debug/breakpoint", {"simix/breakpoint"}, "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0}; } } @@ -240,7 +246,7 @@ void SIMIX_global_init(int *argc, char **argv) }); } - if (simgrid::config::get_value("clean-atexit")) + if (simgrid::config::get_value("debug/clean-atexit")) atexit(SIMIX_clean); } @@ -358,11 +364,7 @@ static bool SIMIX_execute_timers() // 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 out of timer callback"); - } + timer->callback(); delete timer; } return result; @@ -374,7 +376,7 @@ static bool SIMIX_execute_timers() */ void SIMIX_run() { - if (not MC_record_path.empty()) { + if (MC_record_replay_is_active()) { simgrid::mc::replay(MC_record_path); return; } @@ -384,9 +386,9 @@ void SIMIX_run() 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