Skip to content

Commit 4afdab0

Browse files
committed
topo/base: correctly support MPI_UNWEIGHTED in mca_topo_base_dist_graph_neighbors()
Thanks Jun Kudo for the bug report. (back-ported from commit open-mpi/ompi@8aff67c)
1 parent dfcf58e commit 4afdab0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ompi/mca/topo/base/topo_base_dist_graph_neighbors.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* reserved.
99
* Copyright (c) 2011-2012 INRIA. All rights reserved.
1010
* Copyright (c) 2011-2012 Universite Bordeaux 1
11+
* Copyright (c) 2016 Research Organization for Information Science
12+
* and Technology (RIST). All rights reserved.
1113
*/
1214

1315
#include "ompi_config.h"
@@ -34,13 +36,13 @@ int mca_topo_base_dist_graph_neighbors(ompi_communicator_t *comm,
3436

3537
for (i = 0; (i < dg->indegree) && (i < maxindegree); ++i) {
3638
sources[i] = dg->in[i];
37-
if (NULL != dg->inw) {
39+
if (MPI_UNWEIGHTED != sourceweights && NULL != dg->inw) {
3840
sourceweights[i] = dg->inw[i];
3941
}
4042
}
4143
for (i = 0; (i < dg->outdegree) && (i < maxoutdegree); ++i) {
4244
destinations[i] = dg->out[i];
43-
if (NULL != dg->outw) {
45+
if (MPI_UNWEIGHTED != destweights && NULL != dg->outw) {
4446
destweights[i] = dg->outw[i];
4547
}
4648
}

0 commit comments

Comments
 (0)