Skip to content

Commit 3d3faba

Browse files
committed
oshmem: Add symmetric key environment variable
1 parent f4965c4 commit 3d3faba

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
727727
mem_map_params.length = size;
728728
mem_map_params.flags = flags;
729729

730+
if (mca_spml_ucx.symmetric_rkey) {
731+
mem_map_params.flags |= UCP_MEM_MAP_SYMMETRIC_RKEY;
732+
}
733+
730734
status = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &mem_h);
731735
if (UCS_OK != status) {
732736
goto error_out;

oshmem/mca/spml/ucx/spml_ucx_component.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ static int mca_spml_ucx_component_register(void)
153153
"Enable asynchronous progress thread",
154154
&mca_spml_ucx.async_progress);
155155

156+
mca_spml_ucx_param_register_bool("symmetric_rkey", 0,
157+
"Enable remote keys deduplication to save memory at scale (best-effort)",
158+
&mca_spml_ucx.symmetric_rkey);
159+
156160
mca_spml_ucx_param_register_int("async_tick_usec", 3000,
157161
"Asynchronous progress tick granularity (in usec)",
158162
&mca_spml_ucx.async_tick);

oshmem/mca/sshmem/ucx/sshmem_ucx_module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ segment_create_internal(map_segment_t *ds_buf, void *address, size_t size,
126126
mem_map_params.length = size;
127127
mem_map_params.flags = flags;
128128

129+
if (spml->symmetric_rkey) {
130+
mem_map_params.flags |= UCP_MEM_MAP_SYMMETRIC_RKEY;
131+
}
132+
129133
status = ucp_mem_map(spml->ucp_context, &mem_map_params, &mem_h);
130134
if (UCS_OK != status) {
131135
SSHMEM_ERROR("ucp_mem_map() failed: %s\n", ucs_status_string(status));

0 commit comments

Comments
 (0)