From: Arnaud Legrand Date: Wed, 8 Apr 2015 13:01:07 +0000 (+0200) Subject: Adding debug messages X-Git-Tag: v3_12~732^2~61^2^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/308a7ae682761b25e25a3a121d86f4ee051d73cd Adding debug messages --- diff --git a/src/simix/smx_context_thread.c b/src/simix/smx_context_thread.c index fbde818409..1995a3f808 100644 --- a/src/simix/smx_context_thread.c +++ b/src/simix/smx_context_thread.c @@ -188,6 +188,7 @@ static void smx_ctx_thread_runall_serial(void) unsigned int cursor; xbt_dynar_foreach(simix_global->process_to_run, cursor, process) { + XBT_DEBUG("Handling %p",process); xbt_os_sem_release(((smx_ctx_thread_t) process->context)->begin); xbt_os_sem_acquire(((smx_ctx_thread_t) process->context)->end); } diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index cb99d35900..317ea1572c 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -407,9 +407,11 @@ void SIMIX_run(void) } time = SIMIX_timer_next(); - if (time != -1.0 || xbt_swag_size(simix_global->process_list) != 0) + if (time != -1.0 || xbt_swag_size(simix_global->process_list) != 0) { + XBT_DEBUG("Calling surf_solve"); time = surf_solve(time); - + XBT_DEBUG("Moving time ahead : %g", time); + } /* Notify all the hosts that have failed */ /* FIXME: iterate through the list of failed host and mark each of them */ /* as failed. On each host, signal all the running processes with host_fail */ @@ -426,14 +428,19 @@ void SIMIX_run(void) /* Wake up all processes waiting for a Surf action to finish */ xbt_dynar_foreach(model_list, iter, model) { - while ((action = surf_model_extract_failed_action_set(model))) + XBT_DEBUG("Handling process whose action failed"); + while ((action = surf_model_extract_failed_action_set(model))) { + XBT_DEBUG(" Handling Action %p",action); SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action)); - - while ((action = surf_model_extract_done_action_set(model))) + } + XBT_DEBUG("Handling process whose action terminated normally"); + while ((action = surf_model_extract_done_action_set(model))) { + XBT_DEBUG(" Handling Action %p",action); if (surf_action_get_data(action) == NULL) XBT_DEBUG("probably vcpu's action %p, skip", action); else SIMIX_simcall_exit((smx_synchro_t) surf_action_get_data(action)); + } } /* Autorestart all process */ diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index b0c51cd1b6..ce66e94440 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -86,6 +86,7 @@ void SIMIX_process_cleanup(smx_process_t process) } } + XBT_DEBUG("%p should not be run anymore",process); xbt_swag_remove(process, simix_global->process_list); xbt_swag_remove(process, SIMIX_host_priv(process->smx_host)->process_list); xbt_swag_insert(process, simix_global->process_to_destroy); @@ -103,6 +104,8 @@ void SIMIX_process_empty_trash(void) smx_process_t process = NULL; while ((process = xbt_swag_extract(simix_global->process_to_destroy))) { + XBT_DEBUG("Getting rid of %p",process); + SIMIX_context_free(process->context); /* Free the exception allocated at creation time */ @@ -367,6 +370,7 @@ void SIMIX_process_kill(smx_process_t process, smx_process_t issuer) { } } if(!xbt_dynar_member(simix_global->process_to_run, &(process)) && process != issuer) { + XBT_DEBUG("Inserting %s in the to_run list", process->name); xbt_dynar_push_as(simix_global->process_to_run, smx_process_t, process); }