@@ -73,8 +73,7 @@ static int comm_create_local_group(MPIR_Comm * comm_ptr)
7373 MPIR_Lpid * map = MPL_malloc (n * sizeof (MPIR_Lpid ), MPL_MEM_GROUP );
7474
7575 for (int i = 0 ; i < n ; i ++ ) {
76- mpi_errno = MPID_Comm_get_lpid (comm_ptr , i , & map [i ], FALSE);
77- MPIR_ERR_CHECK (mpi_errno );
76+ map [i ] = MPIR_Group_rank_to_lpid (comm_ptr -> local_group , i );
7877 }
7978
8079 mpi_errno = MPIR_Group_create_map (n , comm_ptr -> rank , comm_ptr -> session_ptr , map ,
@@ -238,8 +237,7 @@ int MPII_Comm_create_calculate_mapping(MPIR_Group * group_ptr,
238237 /* FIXME : BUBBLE SORT */
239238 mapping [i ] = -1 ;
240239 for (j = 0 ; j < comm_ptr -> local_size ; j ++ ) {
241- MPIR_Lpid comm_lpid ;
242- MPID_Comm_get_lpid (comm_ptr , j , & comm_lpid , FALSE);
240+ MPIR_Lpid comm_lpid = MPIR_Group_rank_to_lpid (comm_ptr -> local_group , j );
243241 if (comm_lpid == MPIR_Group_rank_to_lpid (group_ptr , i )) {
244242 mapping [i ] = j ;
245243 break ;
@@ -918,8 +916,7 @@ int MPIR_Comm_remote_group_impl(MPIR_Comm * comm_ptr, MPIR_Group ** group_ptr)
918916 MPIR_Lpid * map = MPL_malloc (n * sizeof (MPIR_Lpid ), MPL_MEM_GROUP );
919917
920918 for (int i = 0 ; i < n ; i ++ ) {
921- mpi_errno = MPID_Comm_get_lpid (comm_ptr , i , & map [i ], TRUE);
922- MPIR_ERR_CHECK (mpi_errno );
919+ map [i ] = MPIR_Group_rank_to_lpid (comm_ptr -> remote_group , i );
923920 }
924921 mpi_errno = MPIR_Group_create_map (n , MPI_UNDEFINED , comm_ptr -> session_ptr , map ,
925922 & comm_ptr -> remote_group );
0 commit comments