1
1

Merge pull request #6413 from nuriallv/issue_osc_rdma

osc/rdma: fix when determining the node with the rank_array info for a peer
Этот коммит содержится в:
Nathan Hjelm 2019-02-27 16:30:06 -07:00 коммит произвёл GitHub
родитель 8fd6107987 3cae149262
Коммит 73085e9ce3
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -50,6 +50,8 @@
#include "opal_stdint.h"
#define RANK_ARRAY_COUNT(module) ((ompi_comm_size ((module)->comm) + (module)->node_count - 1) / (module)->node_count)
enum {
OMPI_OSC_RDMA_LOCKING_TWO_LEVEL,
OMPI_OSC_RDMA_LOCKING_ON_DEMAND,

Просмотреть файл

@ -384,8 +384,6 @@ static int ompi_osc_rdma_component_query (struct ompi_win_t *win, void **base, s
return mca_osc_rdma_component.priority;
}
#define RANK_ARRAY_COUNT(module) ((ompi_comm_size ((module)->comm) + (module)->node_count - 1) / (module)->node_count)
static int ompi_osc_rdma_initialize_region (ompi_osc_rdma_module_t *module, void **base, size_t size) {
ompi_osc_rdma_region_t *region = (ompi_osc_rdma_region_t *) module->state->regions;
int ret;

Просмотреть файл

@ -103,7 +103,7 @@ static int ompi_osc_rdma_peer_setup (ompi_osc_rdma_module_t *module, ompi_osc_rd
ompi_osc_rdma_rank_data_t rank_data;
int registration_handle_size = 0;
int node_id, node_rank, array_index;
int ret, disp_unit, comm_size;
int ret, disp_unit;
char *peer_data;
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
registration_handle_size = module->selected_btl->btl_registration_handle_size;
}
comm_size = ompi_comm_size (module->comm);
/* each node is responsible for holding a part of the rank -> node/local rank mapping array. this code
* calculates the node and offset the mapping can be found. once the mapping has been read the state
* part of the peer structure can be initialized. */
node_id = (peer->rank * module->node_count) / comm_size;
node_id = peer->rank / RANK_ARRAY_COUNT(module);
array_peer_data = (ompi_osc_rdma_region_t *) ((intptr_t) module->node_comm_info + node_id * module->region_size);
/* the node leader rank is stored in the length field */
node_rank = NODE_ID_TO_RANK(module, array_peer_data, node_id);
array_index = peer->rank % ((comm_size + module->node_count - 1) / module->node_count);
array_index = peer->rank % RANK_ARRAY_COUNT(module);
array_pointer = array_peer_data->base + array_index * sizeof (rank_data);