diff --git a/ompi/runtime/mpiruntime.h b/ompi/runtime/mpiruntime.h index 574720b1bb..9ff569fb25 100644 --- a/ompi/runtime/mpiruntime.h +++ b/ompi/runtime/mpiruntime.h @@ -14,6 +14,7 @@ * reserved. * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 University of Houston. All rights reserved. + * Copyright (c) 2014 Intel, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -52,6 +53,8 @@ OMPI_DECLSPEC extern bool ompi_mpi_init_started; OMPI_DECLSPEC extern bool ompi_mpi_initialized; /** Has mpi been finalized? */ OMPI_DECLSPEC extern bool ompi_mpi_finalized; +/** Has the RTE been initialized? */ +OMPI_DECLSPEC extern bool ompi_rte_initialized; /** Do we have multiple threads? */ OMPI_DECLSPEC extern bool ompi_mpi_thread_multiple; diff --git a/ompi/runtime/ompi_mpi_abort.c b/ompi/runtime/ompi_mpi_abort.c index 6fc91d1952..9e15ade931 100644 --- a/ompi/runtime/ompi_mpi_abort.c +++ b/ompi/runtime/ompi_mpi_abort.c @@ -129,7 +129,7 @@ ompi_mpi_abort(struct ompi_communicator_t* comm, initialized period of time, so no need to check that here. Sorry, Charlie... */ - if (!ompi_mpi_initialized || ompi_mpi_finalized) { + if ((!ompi_mpi_initialized || ompi_mpi_finalized) && !ompi_rte_initialized) { fprintf(stderr, "[%s:%d] Local abort %s completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!\n", host, (int) pid, ompi_mpi_finalized ? "after MPI_FINALIZE" : "before MPI_INIT"); diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index d1e11be778..1af32581ea 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -422,6 +422,7 @@ int ompi_mpi_finalize(void) if (OMPI_SUCCESS != (ret = ompi_rte_finalize())) { return ret; } + ompi_rte_initialized = false; /* now close the rte framework */ if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_rte_base_framework) ) ) { diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index eb851d4c99..324bc15909 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -123,6 +123,7 @@ const char ompi_version_string[] = OMPI_IDENT_STRING; bool ompi_mpi_init_started = false; bool ompi_mpi_initialized = false; bool ompi_mpi_finalized = false; +bool ompi_rte_initialized = false; bool ompi_mpi_thread_multiple = false; int ompi_mpi_thread_requested = MPI_THREAD_SINGLE; @@ -380,7 +381,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) size_t nprocs; char *error = NULL; struct timeval ompistart, ompistop; - bool rte_setup = false; ompi_rte_collective_t *coll; char *cmd=NULL, *av=NULL; @@ -470,7 +470,7 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) error = "ompi_mpi_init: ompi_rte_init failed"; goto error; } - rte_setup = true; + ompi_rte_initialized = true; /* check for timing request - get stop time and report elapsed time if so */ if (ompi_enable_timing && 0 == OMPI_PROC_MY_NAME->vpid) { @@ -955,16 +955,9 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) /* Only print a message if one was not already printed */ if (NULL != error) { const char *err_msg = opal_strerror(ret); - /* If RTE was not setup yet, don't use opal_show_help */ - if (rte_setup) { - opal_show_help("help-mpi-runtime", - "mpi_init:startup:internal-failure", true, - "MPI_INIT", "MPI_INIT", error, err_msg, ret); - } else { - opal_show_help("help-mpi-runtime", - "mpi_init:startup:internal-failure", true, - "MPI_INIT", "MPI_INIT", error, err_msg, ret); - } + opal_show_help("help-mpi-runtime", + "mpi_init:startup:internal-failure", true, + "MPI_INIT", "MPI_INIT", error, err_msg, ret); } return ret; }