comm: fix coverity issues
CID 1269683 Unchecked return value (CHECKED_RETURN) CID 1269684 Unchecked return value (CHECKED_RETURN) Use ompi_comm_rank instead of MPI_Comm_rank here. There is no reason to be using the MPI interface over the internal interface. This should clear up these issues. Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Этот коммит содержится в:
родитель
632f829eb7
Коммит
69a0e1dd08
@ -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;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user