1
1

Merge pull request #620 from hjelmn/ompi_coverity

ompi coverity fixes
Этот коммит содержится в:
Nathan Hjelm 2015-06-16 06:10:40 -06:00
родитель 9a8bda0b72 69a0e1dd08
Коммит c33b786dd9
6 изменённых файлов: 24 добавлений и 9 удалений

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

@ -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 <htor@cs.indiana.edu>
*
@ -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;

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

@ -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))) {

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

@ -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;

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

@ -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;

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

@ -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;

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

@ -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;