diff --git a/ompi/communicator/comm_helpers.c b/ompi/communicator/comm_helpers.c index 0f0eb65321..247883fa09 100644 --- a/ompi/communicator/comm_helpers.c +++ b/ompi/communicator/comm_helpers.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2006 The Trustees of Indiana University and Indiana * University Research and Technology @@ -6,6 +7,8 @@ * rights reserved. * Copyright (c) 2014 Research Organization for Information Science * and Technology (RIST). All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * * Author(s): Torsten Hoefler * @@ -27,7 +30,7 @@ int ompi_comm_neighbors_count(MPI_Comm comm, int *indegree, int *outdegree, int *weighted = 0; } else if (OMPI_COMM_IS_GRAPH(comm)) { int rank, nneighbors; - MPI_Comm_rank(comm, &rank); + rank = ompi_comm_rank ((ompi_communicator_t *) comm); res = MPI_Graph_neighbors_count(comm, rank, &nneighbors); if (MPI_SUCCESS != res) { return res; @@ -70,8 +73,7 @@ int ompi_comm_neighbors(MPI_Comm comm, int maxindegree, int sources[], int sourc sources[index] = destinations[index] = speer; index++; } } else if (OMPI_COMM_IS_GRAPH(comm)) { - int rank; - MPI_Comm_rank(comm, &rank); + int rank = ompi_comm_rank ((ompi_communicator_t *) comm); res = MPI_Graph_neighbors(comm, rank, maxindegree, sources); if (MPI_SUCCESS != res) { return res; diff --git a/ompi/mca/topo/base/topo_base_lazy_init.c b/ompi/mca/topo/base/topo_base_lazy_init.c index 04db474670..42dc376f75 100644 --- a/ompi/mca/topo/base/topo_base_lazy_init.c +++ b/ompi/mca/topo/base/topo_base_lazy_init.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology @@ -11,6 +12,8 @@ * All rights reserved. * Copyright (c) 2009 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2015 Inria. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -39,7 +42,12 @@ int mca_topo_base_lazy_init(void) /** * Register and open all available components, giving them a chance to access the MCA parameters. */ - mca_base_framework_open (&ompi_topo_base_framework, MCA_BASE_REGISTER_DEFAULT); + + err = mca_base_framework_open (&ompi_topo_base_framework, MCA_BASE_REGISTER_DEFAULT); + if (OMPI_SUCCESS != err) { + return err; + } + if (OMPI_SUCCESS != (err = mca_topo_base_find_available(OPAL_ENABLE_PROGRESS_THREADS, OMPI_ENABLE_THREAD_MULTIPLE))) { diff --git a/ompi/mpi/tool/mpit_common.c b/ompi/mpi/tool/mpit_common.c index 015a8faa5f..785b8c0d83 100644 --- a/ompi/mpi/tool/mpit_common.c +++ b/ompi/mpi/tool/mpit_common.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -80,6 +80,11 @@ int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype int ompit_opal_to_mpit_error (int rc) { + if (rc >= 0) { + /* Already an MPI error (always >= 0) */ + return rc; + } + switch (rc) { case OPAL_SUCCESS: return MPI_SUCCESS; diff --git a/ompi/mpi/tool/pvar_reset.c b/ompi/mpi/tool/pvar_reset.c index 1091db0dcc..cf05f58ea8 100644 --- a/ompi/mpi/tool/pvar_reset.c +++ b/ompi/mpi/tool/pvar_reset.c @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* - * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights + * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ @@ -23,7 +23,7 @@ int MPI_T_pvar_reset(MPI_T_pvar_session session, MPI_T_pvar_handle handle) { - int ret; + int ret = MPI_SUCCESS; if (!mpit_is_initialized ()) { return MPI_T_ERR_NOT_INITIALIZED; diff --git a/ompi/mpi/tool/pvar_start.c b/ompi/mpi/tool/pvar_start.c index 0f8e71f814..667c3cc486 100644 --- a/ompi/mpi/tool/pvar_start.c +++ b/ompi/mpi/tool/pvar_start.c @@ -32,7 +32,7 @@ static int pvar_handle_start (mca_base_pvar_handle_t *handle) int MPI_T_pvar_start(MPI_T_pvar_session session, MPI_T_pvar_handle handle) { - int ret; + int ret = MPI_SUCCESS; if (!mpit_is_initialized ()) { return MPI_T_ERR_NOT_INITIALIZED; diff --git a/ompi/mpi/tool/pvar_stop.c b/ompi/mpi/tool/pvar_stop.c index 9caf60f046..0866ac46a0 100644 --- a/ompi/mpi/tool/pvar_stop.c +++ b/ompi/mpi/tool/pvar_stop.c @@ -32,7 +32,7 @@ static int pvar_handle_stop (mca_base_pvar_handle_t *handle) int MPI_T_pvar_stop(MPI_T_pvar_session session, MPI_T_pvar_handle handle) { - int ret; + int ret = MPI_SUCCESS; if (!mpit_is_initialized ()) { return MPI_T_ERR_NOT_INITIALIZED;