Skip to content

Commit 6f5a0a5

Browse files
xinzhao3Tomislav Janjusic
authored andcommitted
ompi/oshmem/spml/ucx:delete oob path of getting rkeys in spml ucx
Signed-off-by: Tomislav Janjusic <[email protected]> (cherry picked from commit 1b9eaa2)
1 parent 83cf146 commit 6f5a0a5

File tree

2 files changed

+12
-54
lines changed

2 files changed

+12
-54
lines changed

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
#define SPML_UCX_PUT_DEBUG 0
4545
#endif
4646

47-
static
48-
spml_ucx_mkey_t * mca_spml_ucx_get_mkey_slow(shmem_ctx_t ctx, int pe, void *va, void **rva);
49-
5047
mca_spml_ucx_t mca_spml_ucx = {
5148
.super = {
5249
/* Init mca_spml_base_module_t */
@@ -80,7 +77,7 @@ mca_spml_ucx_t mca_spml_ucx = {
8077
.num_disconnect = 1,
8178
.heap_reg_nb = 0,
8279
.enabled = 0,
83-
.get_mkey_slow = mca_spml_ucx_get_mkey_slow
80+
.get_mkey_slow = NULL
8481
};
8582

8683
OBJ_CLASS_INSTANCE(mca_spml_ucx_ctx_list_item_t, opal_list_item_t, NULL, NULL);
@@ -313,37 +310,6 @@ int mca_spml_ucx_add_procs(ompi_proc_t** procs, size_t nprocs)
313310

314311
}
315312

316-
317-
static
318-
spml_ucx_mkey_t * mca_spml_ucx_get_mkey_slow(shmem_ctx_t ctx, int pe, void *va, void **rva)
319-
{
320-
sshmem_mkey_t *r_mkey;
321-
spml_ucx_mkey_t *ucx_mkey;
322-
uint32_t segno;
323-
mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx;
324-
ucs_status_t err;
325-
326-
r_mkey = mca_memheap_base_get_cached_mkey(ctx, pe, va, 0, rva);
327-
if (OPAL_UNLIKELY(!r_mkey)) {
328-
SPML_UCX_ERROR("pe=%d: %p is not address of symmetric variable",
329-
pe, va);
330-
oshmem_shmem_abort(-1);
331-
return NULL;
332-
}
333-
334-
segno = memheap_find_segnum(va);
335-
ucx_mkey = &ucx_ctx->ucp_peers[pe].mkeys[segno].key;
336-
337-
if (ucx_mkey->rkey == NULL) {
338-
err = ucp_ep_rkey_unpack(ucx_ctx->ucp_peers[pe].ucp_conn,
339-
r_mkey->u.data,
340-
&ucx_mkey->rkey);
341-
mca_spml_ucx_cache_mkey(ucx_ctx, r_mkey, segno, pe); /* make sure it is properly cached */
342-
}
343-
344-
return ucx_mkey;
345-
}
346-
347313
void mca_spml_ucx_rmkey_free(sshmem_mkey_t *mkey)
348314
{
349315
spml_ucx_mkey_t *ucx_mkey;
@@ -595,24 +561,19 @@ int mca_spml_ucx_ctx_create(long options, shmem_ctx_t *ctx)
595561
}
596562

597563
for (j = 0; j < MCA_MEMHEAP_SEG_COUNT; j++) {
598-
ctx_item->ctx.ucp_peers[i].mkeys[j].key.rkey = NULL;
564+
mkey = &memheap_map->mem_segs[j].mkeys_cache[i][0];
565+
ucx_mkey = &ctx_item->ctx.ucp_peers[i].mkeys[j].key;
566+
err = ucp_ep_rkey_unpack(ctx_item->ctx.ucp_peers[i].ucp_conn,
567+
mkey->u.data,
568+
&ucx_mkey->rkey);
569+
if (UCS_OK != err) {
570+
SPML_UCX_ERROR("failed to unpack rkey");
571+
goto error2;
572+
}
573+
mca_spml_ucx_cache_mkey(&ctx_item->ctx, mkey, j, i);
599574
}
600575
}
601576

602-
for (i = 0; i < MCA_MEMHEAP_SEG_COUNT; i++) {
603-
mkey = &memheap_map->mem_segs[i].mkeys_cache[my_pe][0];
604-
ucx_mkey = &ctx_item->ctx.ucp_peers[my_pe].mkeys[i].key;
605-
err = ucp_ep_rkey_unpack(ctx_item->ctx.ucp_peers[my_pe].ucp_conn,
606-
mkey->u.data,
607-
&ucx_mkey->rkey);
608-
if (UCS_OK != err) {
609-
SPML_UCX_ERROR("failed to unpack rkey");
610-
goto error2;
611-
}
612-
613-
mca_spml_ucx_cache_mkey(&ctx_item->ctx, mkey, i, my_pe);
614-
}
615-
616577
SHMEM_MUTEX_LOCK(mca_spml_ucx.internal_mutex);
617578

618579
opal_list_append(&(mca_spml_ucx.ctx_list), &ctx_item->super);

oshmem/mca/spml/ucx/spml_ucx.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,7 @@ mca_spml_ucx_get_mkey(shmem_ctx_t ctx, int pe, void *va, void **rva, mca_spml_uc
170170

171171
mkey = ucx_ctx->ucp_peers[pe].mkeys;
172172
mkey = (spml_ucx_cached_mkey_t *)map_segment_find_va(&mkey->super.super, sizeof(*mkey), va);
173-
if (OPAL_UNLIKELY(NULL == mkey)) {
174-
assert(module->get_mkey_slow);
175-
return module->get_mkey_slow(ctx, pe, va, rva);
176-
}
173+
assert(mkey != NULL);
177174
*rva = map_segment_va2rva(&mkey->super, va);
178175
return &mkey->key;
179176
}

0 commit comments

Comments
 (0)