@@ -103,7 +103,7 @@ static int ompi_osc_rdma_peer_setup (ompi_osc_rdma_module_t *module, ompi_osc_rd
103
103
ompi_osc_rdma_rank_data_t rank_data ;
104
104
int registration_handle_size = 0 ;
105
105
int node_id , node_rank , array_index ;
106
- int ret , disp_unit , comm_size ;
106
+ int ret , disp_unit ;
107
107
char * peer_data ;
108
108
109
109
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_DEBUG , "configuring peer for rank %d" , peer -> rank );
@@ -112,17 +112,15 @@ static int ompi_osc_rdma_peer_setup (ompi_osc_rdma_module_t *module, ompi_osc_rd
112
112
registration_handle_size = module -> selected_btl -> btl_registration_handle_size ;
113
113
}
114
114
115
- comm_size = ompi_comm_size (module -> comm );
116
-
117
115
/* each node is responsible for holding a part of the rank -> node/local rank mapping array. this code
118
116
* calculates the node and offset the mapping can be found. once the mapping has been read the state
119
117
* part of the peer structure can be initialized. */
120
- node_id = ( peer -> rank * module -> node_count ) / comm_size ;
118
+ node_id = peer -> rank / RANK_ARRAY_COUNT ( module ) ;
121
119
array_peer_data = (ompi_osc_rdma_region_t * ) ((intptr_t ) module -> node_comm_info + node_id * module -> region_size );
122
120
123
121
/* the node leader rank is stored in the length field */
124
122
node_rank = NODE_ID_TO_RANK (module , array_peer_data , node_id );
125
- array_index = peer -> rank % (( comm_size + module -> node_count - 1 ) / module -> node_count );
123
+ array_index = peer -> rank % RANK_ARRAY_COUNT ( module );
126
124
127
125
array_pointer = array_peer_data -> base + array_index * sizeof (rank_data );
128
126
0 commit comments