1
1

Merge pull request #603 from hjelmn/orte_coverity

orte_quit: Remove logically dead code
Этот коммит содержится в:
rhc54 2015-05-28 08:35:02 -07:00
родитель 9c170a8c00 7db48c581d
Коммит 83eec67952

Просмотреть файл

@ -1,5 +1,5 @@
/* -*- C -*- /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
* /*
* Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
* University Research and Technology * University Research and Technology
* Corporation. All rights reserved. * Corporation. All rights reserved.
@ -12,7 +12,7 @@
* All rights reserved. * All rights reserved.
* Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2007-2009 Sun Microsystems, Inc. All rights reserved.
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
* reserved. * reserved.
* Copyright (c) 2012 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2014 Intel, Inc. All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved.
@ -168,9 +168,7 @@ static void dump_aborted_procs(void)
ORTE_JOB_STATE_RUNNING != job->state && ORTE_JOB_STATE_RUNNING != job->state &&
ORTE_JOB_STATE_TERMINATED != job->state && ORTE_JOB_STATE_TERMINATED != job->state &&
ORTE_JOB_STATE_ABORT_ORDERED != job->state) { ORTE_JOB_STATE_ABORT_ORDERED != job->state) {
/* this is a guilty party */
proc = NULL;
orte_get_attribute(&job->attributes, ORTE_JOB_ABORTED_PROC, (void**)&proc, OPAL_PTR);
/* cycle through and count the number that were killed or aborted */ /* cycle through and count the number that were killed or aborted */
for (i=0; i < job->procs->size; i++) { for (i=0; i < job->procs->size; i++) {
if (NULL == (pptr = (orte_proc_t*)opal_pointer_array_get_item(job->procs, i))) { if (NULL == (pptr = (orte_proc_t*)opal_pointer_array_get_item(job->procs, i))) {
@ -189,7 +187,10 @@ static void dump_aborted_procs(void)
} }
} }
if (NULL == proc) { /* this is a guilty party */
proc = NULL;
if (!orte_get_attribute(&job->attributes, ORTE_JOB_ABORTED_PROC, (void**)&proc, OPAL_PTR) ||
NULL == proc) {
continue; continue;
} }
@ -197,11 +198,6 @@ static void dump_aborted_procs(void)
node = proc->node; node = proc->node;
if (ORTE_JOB_STATE_FAILED_TO_START == job->state || if (ORTE_JOB_STATE_FAILED_TO_START == job->state ||
ORTE_JOB_STATE_FAILED_TO_LAUNCH == job->state) { ORTE_JOB_STATE_FAILED_TO_LAUNCH == job->state) {
if (NULL == proc) {
orte_show_help("help-orterun.txt", "orterun:proc-failed-to-start-no-status-no-node", true,
orte_basename);
return;
}
switch (proc->exit_code) { switch (proc->exit_code) {
case ORTE_ERR_SILENT: case ORTE_ERR_SILENT:
/* say nothing - it was already reported */ /* say nothing - it was already reported */
@ -323,43 +319,28 @@ static void dump_aborted_procs(void)
break; break;
} }
} else if (ORTE_JOB_STATE_ABORTED == job->state) { } else if (ORTE_JOB_STATE_ABORTED == job->state) {
if (NULL == proc) { orte_show_help("help-orterun.txt", "orterun:proc-ordered-abort", true,
orte_show_help("help-orterun.txt", "orterun:proc-aborted-unknown", true, orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
orte_basename); node->name, orte_basename);
} else {
orte_show_help("help-orterun.txt", "orterun:proc-ordered-abort", true,
orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
node->name, orte_basename);
}
} else if (ORTE_JOB_STATE_ABORTED_BY_SIG == job->state) { /* aborted by signal */ } else if (ORTE_JOB_STATE_ABORTED_BY_SIG == job->state) { /* aborted by signal */
if (NULL == proc) {
orte_show_help("help-orterun.txt", "orterun:proc-aborted-signal-unknown", true,
orte_basename);
} else {
#ifdef HAVE_STRSIGNAL #ifdef HAVE_STRSIGNAL
if (NULL != strsignal(WTERMSIG(proc->exit_code))) { if (NULL != strsignal(WTERMSIG(proc->exit_code))) {
orte_show_help("help-orterun.txt", "orterun:proc-aborted-strsignal", true, orte_show_help("help-orterun.txt", "orterun:proc-aborted-strsignal", true,
orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
node->name, WTERMSIG(proc->exit_code),
strsignal(WTERMSIG(proc->exit_code)));
} else {
#endif
orte_show_help("help-orterun.txt", "orterun:proc-aborted", true,
orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
node->name, WTERMSIG(proc->exit_code));
#ifdef HAVE_STRSIGNAL
}
#endif
}
} else if (ORTE_JOB_STATE_ABORTED_WO_SYNC == job->state) { /* proc exited w/o finalize */
if (NULL == proc) {
orte_show_help("help-orterun.txt", "orterun:proc-exit-no-sync-unknown", true,
orte_basename, orte_basename);
} else {
orte_show_help("help-orterun.txt", "orterun:proc-exit-no-sync", true,
orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid, orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
node->name, orte_basename, orte_basename); node->name, WTERMSIG(proc->exit_code),
strsignal(WTERMSIG(proc->exit_code)));
} else {
#endif
orte_show_help("help-orterun.txt", "orterun:proc-aborted", true,
orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
node->name, WTERMSIG(proc->exit_code));
#ifdef HAVE_STRSIGNAL
} }
#endif
} else if (ORTE_JOB_STATE_ABORTED_WO_SYNC == job->state) { /* proc exited w/o finalize */
orte_show_help("help-orterun.txt", "orterun:proc-exit-no-sync", true,
orte_basename, (unsigned long)proc->name.vpid, (unsigned long)proc->pid,
node->name, orte_basename, orte_basename);
} else if (ORTE_JOB_STATE_COMM_FAILED == job->state) { } else if (ORTE_JOB_STATE_COMM_FAILED == job->state) {
orte_show_help("help-orterun.txt", "orterun:proc-comm-failed", true, orte_show_help("help-orterun.txt", "orterun:proc-comm-failed", true,
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),