@@ -103,7 +103,7 @@ static int ompi_osc_rdma_peer_setup (ompi_osc_rdma_module_t *module, ompi_osc_rd
103103 ompi_osc_rdma_rank_data_t rank_data ;
104104 int registration_handle_size = 0 ;
105105 int node_id , node_rank , array_index ;
106- int ret , disp_unit , comm_size ;
106+ int ret , disp_unit ;
107107 char * peer_data ;
108108
109109 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
112112 registration_handle_size = module -> selected_btl -> btl_registration_handle_size ;
113113 }
114114
115- comm_size = ompi_comm_size (module -> comm );
116-
117115 /* each node is responsible for holding a part of the rank -> node/local rank mapping array. this code
118116 * calculates the node and offset the mapping can be found. once the mapping has been read the state
119117 * 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 ) ;
121119 array_peer_data = (ompi_osc_rdma_region_t * ) ((intptr_t ) module -> node_comm_info + node_id * module -> region_size );
122120
123121 /* the node leader rank is stored in the length field */
124122 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 );
126124
127125 array_pointer = array_peer_data -> base + array_index * sizeof (rank_data );
128126
0 commit comments