1
1
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
2
2
/*
3
- * Copyright (c) 2011-2017 The University of Tennessee and The University
3
+ * Copyright (c) 2011-2023 The University of Tennessee and The University
4
4
* of Tennessee Research Foundation. All rights
5
5
* reserved.
6
6
* 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,
705
705
if (OMPI_SUCCESS != (err = ompi_comm_split (comm_old , 0 , newrank , newcomm , false))) {
706
706
goto release_and_return ;
707
707
}
708
- /* end of TODO */
709
708
710
709
/* Attach the dist_graph to the newly created communicator */
711
710
(* 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,
945
944
free (grank_to_lrank );
946
945
goto release_and_return ;
947
946
}
948
- /* end of TODO */
949
947
950
948
/* Attach the dist_graph to the newly created communicator */
951
949
(* 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,
956
954
free (lrank_to_grank );
957
955
} /* distributed reordering end */
958
956
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 );
959
968
release_and_return :
960
969
if (NULL != reqs ) free (reqs );
961
970
if (NULL != tracker ) free (tracker );
0 commit comments