Skip to content

Commit 52b52b8

Browse files
committed
OSC RDMA: only touch pages before memory registration, don't fill them
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent d11ccba commit 52b52b8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ompi/mca/osc/rdma/osc_rdma_component.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,8 +650,12 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
650650
}
651651

652652
if (size && MPI_WIN_FLAVOR_ALLOCATE == module->flavor) {
653-
*base = (void *)((intptr_t) module->segment_base + my_base_offset);
654-
memset (*base, 0, size);
653+
char *baseptr = (char *)((intptr_t) module->segment_base + my_base_offset);
654+
*base = (void *)baseptr;
655+
// touch each page to force allocation on local NUMA node
656+
for (size_t i = 0; i < size; i += page_size) {
657+
baseptr[i] = 0;
658+
}
655659
}
656660

657661
module->rank_array = (ompi_osc_rdma_rank_data_t *) module->segment_base;

0 commit comments

Comments
 (0)