11/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22/*
3- * Copyright (c) 2011-2017 The University of Tennessee and The University
3+ * Copyright (c) 2011-2023 The University of Tennessee and The University
44 * of Tennessee Research Foundation. All rights
55 * reserved.
66 * Copyright (c) 2011-2018 Inria. All rights reserved.
@@ -705,7 +705,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
705705 if (OMPI_SUCCESS != (err = ompi_comm_split (comm_old , 0 , newrank , newcomm , false))) {
706706 goto release_and_return ;
707707 }
708- /* end of TODO */
709708
710709 /* Attach the dist_graph to the newly created communicator */
711710 (* newcomm )-> c_flags |= OMPI_COMM_DIST_GRAPH ;
@@ -945,7 +944,6 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
945944 free (grank_to_lrank );
946945 goto release_and_return ;
947946 }
948- /* end of TODO */
949947
950948 /* Attach the dist_graph to the newly created communicator */
951949 (* newcomm )-> c_flags |= OMPI_COMM_DIST_GRAPH ;
@@ -956,6 +954,17 @@ int mca_topo_treematch_dist_graph_create(mca_topo_base_module_t* topo_module,
956954 free (lrank_to_grank );
957955 } /* distributed reordering end */
958956
957+ /* Translate the ranks provided by the user to account for the reordered communicator.
958+ * Note that this operation is safe to be done in place, directly into the in/out arrays.
959+ */
960+ ompi_group_translate_ranks (comm_old -> c_remote_group , topo -> indegree ,
961+ topo -> in ,
962+ (* newcomm )-> c_remote_group ,
963+ topo -> in );
964+ ompi_group_translate_ranks (comm_old -> c_remote_group , topo -> outdegree ,
965+ topo -> out ,
966+ (* newcomm )-> c_remote_group ,
967+ topo -> out );
959968 release_and_return :
960969 if (NULL != reqs ) free (reqs );
961970 if (NULL != tracker ) free (tracker );
0 commit comments