Skip to content

Commit 93078ad

Browse files
authored
Merge pull request #3551 from markalle/1sided_some_single
1sided with some hosts single rank -- Fixes #3548
2 parents 51b2c42 + c9f31a8 commit 93078ad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ static int allocate_state_single (ompi_osc_rdma_module_t *module, void **base, s
394394

395395
/* allocate anything that will be accessed remotely in the same region. this cuts down on the number of
396396
* registration handles needed to access this data. */
397-
total_size = module->state_size + local_rank_array_size + leader_peer_data_size;
397+
total_size = local_rank_array_size + module->region_size +
398+
module->state_size + leader_peer_data_size;
398399

399400
if (MPI_WIN_FLAVOR_ALLOCATE == module->flavor) {
400401
total_size += size;
@@ -409,7 +410,11 @@ static int allocate_state_single (ompi_osc_rdma_module_t *module, void **base, s
409410
return OMPI_ERR_OUT_OF_RESOURCE;
410411
}
411412

412-
module->state_offset = local_rank_array_size;
413+
// Note, the extra module->region_size space added after local_rank_array_size
414+
// is unused but is there to match what happens in allocte_state_shared()
415+
// This allows module->state_offset to be uniform across the ranks which
416+
// is part of how they pull peer info from each other.
417+
module->state_offset = local_rank_array_size + module->region_size;
413418

414419
module->state = (ompi_osc_rdma_state_t *) ((intptr_t) module->rank_array + module->state_offset);
415420
module->node_comm_info = (unsigned char *) ((intptr_t) module->state + module->state_size);

0 commit comments

Comments
 (0)