while (xbt_dynar_length(simix_global->process_to_run)) {
XBT_DEBUG("New Sub-Schedule Round; size(queue)=%lu",
xbt_dynar_length(simix_global->process_to_run));
- SIMIX_context_runall(simix_global->process_to_run);
- xbt_dynar_t tmp = simix_global->process_that_ran;
- simix_global->process_that_ran = simix_global->process_to_run;
- simix_global->process_to_run = tmp;
- xbt_dynar_reset(simix_global->process_to_run);
+ SIMIX_process_runall();
xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
if (process->request.call != REQ_NO_REQ) {
XBT_DEBUG("Handling request %p", &process->request);
}
}
- time = surf_solve(SIMIX_timer_next());
+ time = SIMIX_timer_next();
+ if (time != -1.0 || xbt_swag_size(simix_global->process_list) != 0)
+ time = surf_solve(time);
/* Notify all the hosts that have failed */
/* FIXME: iterate through the list of failed host and mark each of them */
SIMIX_request_post((smx_action_t) action->data);
}
}
- } while (time != -1.0);
+
+ /* Clean processes to destroy */
+ SIMIX_process_empty_trash();
+
+ } while (time != -1.0 || xbt_dynar_length(simix_global->process_to_run) > 0);
if (xbt_swag_size(simix_global->process_list) != 0) {
XBT_INFO("%d processes are still running, waiting for something.", nbprocess);
/* List the process and their state */
XBT_INFO
- ("Legend of the following listing: \"<process> on <host>: <status>.\"");
+ ("Legend of the following listing: \"<process>(<pid>) on <host>: <status>.\"");
xbt_swag_foreach(process, simix_global->process_list) {
if (process->waiting_action) {
action_description = "I/O";
break;
}
- XBT_INFO("Waiting for %s action %p to finish", action_description, process->waiting_action);
+ XBT_INFO("Process %ld (%s@%s): waiting for %s action %p (%s) in state %d to finish",
+ process->pid, process->name, process->smx_host->name,
+ action_description, process->waiting_action,
+ process->waiting_action->name, process->waiting_action->state);
+ }
+ else {
+ XBT_INFO("Process %ld (%s@%s)", process->pid, process->name, process->smx_host->name);
}
}
}