X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/728a1c266d918708c40045c08980ef68ce696833..7341151507abf1d7931e8ca2df777541b5f6bfe2:/src/simix/smx_global.cpp diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index b1e0b70468..9d33439151 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -165,6 +165,8 @@ static std::function maestro_code; namespace simgrid { namespace simix { +simgrid::xbt::signal onDeadlock; + XBT_PUBLIC(void) set_maestro(std::function code) { maestro_code = std::move(code); @@ -531,9 +533,9 @@ void SIMIX_run() } while (again); /* Autorestart all process */ - for (auto hostname: host_that_restart) { - XBT_INFO("Restart processes on host: %s", hostname.c_str()); - SIMIX_host_autorestart(sg_host_by_name(hostname.c_str())); + for (auto host: host_that_restart) { + XBT_INFO("Restart processes on host: %s", sg_host_get_name(host)); + SIMIX_host_autorestart(host); } host_that_restart.clear(); @@ -542,11 +544,15 @@ void SIMIX_run() XBT_DEBUG("### time %f, empty %d", time, xbt_dynar_is_empty(simix_global->process_to_run)); + if (xbt_dynar_is_empty(simix_global->process_to_run) && + xbt_swag_size(simix_global->process_list) != 0) + simgrid::simix::onDeadlock(); + } while (time > -1.0 || !xbt_dynar_is_empty(simix_global->process_to_run)); if (xbt_swag_size(simix_global->process_list) != 0) { - TRACE_end(); + TRACE_end(); XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean."); SIMIX_display_process_status();