Skip to content

Commit 569239e

Browse files
GuillaumeMercierbosilca
authored andcommitted
Check if topo weighted in case of partially distrib case
Signed-off-by: George Bosilca <[email protected]>
1 parent 1d7cca7 commit 569239e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ompi/mca/topo/treematch/topo_treematch_dist_graph_create.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,12 +718,14 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
718718
local_pattern = (double *)calloc(num_procs_in_node, sizeof(double));
719719
}
720720
/* Extract the local communication pattern */
721-
for(i = 0; i < topo->indegree; i++)
722-
if (grank_to_lrank[topo->in[i]] != -1)
723-
local_pattern[grank_to_lrank[topo->in[i]]] += topo->inw[i];
724-
for(i = 0; i < topo->outdegree; i++)
725-
if (grank_to_lrank[topo->out[i]] != -1)
726-
local_pattern[grank_to_lrank[topo->out[i]]] += topo->outw[i];
721+
if( true == topo->weighted ) {
722+
for(i = 0; i < topo->indegree; i++)
723+
if (grank_to_lrank[topo->in[i]] != -1)
724+
local_pattern[grank_to_lrank[topo->in[i]]] += topo->inw[i];
725+
for(i = 0; i < topo->outdegree; i++)
726+
if (grank_to_lrank[topo->out[i]] != -1)
727+
local_pattern[grank_to_lrank[topo->out[i]]] += topo->outw[i];
728+
}
727729
if (OMPI_SUCCESS != (err = localcomm->c_coll->coll_gather((rank == lindex_to_grank[0] ? MPI_IN_PLACE : local_pattern),
728730
num_procs_in_node, MPI_DOUBLE,
729731
local_pattern, num_procs_in_node, MPI_DOUBLE,

0 commit comments

Comments
 (0)