Skip to content

Commit 051134c

Browse files
committed
oshmem: Don't deduplicate rkeys of local node
1 parent 3a1284a commit 051134c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,11 @@ int mca_spml_ucx_ctx_mkey_add(mca_spml_ucx_ctx_t *ucx_ctx, int pe, uint32_t segn
255255
return OSHMEM_ERROR;
256256
}
257257

258-
(*ucx_mkey)->rkey = mca_spml_ucx_rkey_store_get(&mca_spml_ucx.rkey_store, rkey);
258+
if (!oshmem_proc_on_local_node(pe)) {
259+
rkey = mca_spml_ucx_rkey_store_get(&mca_spml_ucx.rkey_store, rkey);
260+
}
261+
262+
(*ucx_mkey)->rkey = rkey;
259263

260264
rc = mca_spml_ucx_ctx_mkey_cache(ucx_ctx, mkey, segno, pe);
261265
if (OSHMEM_SUCCESS != rc) {
@@ -271,7 +275,11 @@ int mca_spml_ucx_ctx_mkey_del(mca_spml_ucx_ctx_t *ucx_ctx, int pe, uint32_t segn
271275
ucp_peer_t *ucp_peer;
272276
int rc;
273277
ucp_peer = &(ucx_ctx->ucp_peers[pe]);
274-
mca_spml_ucx_rkey_store_put(&mca_spml_ucx.rkey_store, ucx_mkey->rkey);
278+
if (!oshmem_proc_on_local_node(pe)) {
279+
mca_spml_ucx_rkey_store_put(&mca_spml_ucx.rkey_store, ucx_mkey->rkey);
280+
} else {
281+
ucp_rkey_destroy(ucx_mkey->rkey);
282+
}
275283
ucx_mkey->rkey = NULL;
276284
rc = mca_spml_ucx_peer_mkey_cache_del(ucp_peer, segno);
277285
if(OSHMEM_SUCCESS != rc){

0 commit comments

Comments
 (0)