Skip to content
Snippets Groups Projects
Commit 6f8fc6c7 authored by Moe Jette's avatar Moe Jette
Browse files

Report on first <ctrl-c> that second one require to forward signal.

Combine line task states on a single line, not one per task.
parent 83a8e6ef
No related branches found
No related tags found
No related merge requests found
......@@ -293,11 +293,26 @@ static char *_host_state_name(host_state_t state_inx)
void report_task_status(job_t *job)
{
int i;
int i, j;
int first_task, last_task;
task_state_t current_state;
for (i = 0; i < opt.nprocs; i++) {
info ("task:%d state:%s", i,
_task_state_name(job->task_state[i]));
current_state = job->task_state[i];
first_task = last_task = i;
for (j = (i+1); j < opt.nprocs; j++) {
if (current_state == job->task_state[i])
last_task = j;
else
break;
}
if (first_task == last_task)
info ("task:%d state:%s", first_task,
_task_state_name(current_state));
else
info ("tasks:%d-%d state:%s", first_task, last_task,
_task_state_name(current_state));
i = last_task;
}
}
......
......@@ -517,6 +517,7 @@ _sig_thr(void *arg)
switch (signo) {
case SIGINT:
if ((time(NULL) - last_intr) > 1) {
info("interrupt (one more within 1 sec to abort)");
report_task_status(job);
last_intr = time(NULL);
} else { /* second Ctrl-C in half as many seconds */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment