|
44 | 44 | #define SPML_UCX_PUT_DEBUG 0 |
45 | 45 | #endif |
46 | 46 |
|
47 | | -static |
48 | | -spml_ucx_mkey_t * mca_spml_ucx_get_mkey_slow(shmem_ctx_t ctx, int pe, void *va, void **rva); |
49 | | - |
50 | 47 | mca_spml_ucx_t mca_spml_ucx = { |
51 | 48 | .super = { |
52 | 49 | /* Init mca_spml_base_module_t */ |
@@ -80,7 +77,7 @@ mca_spml_ucx_t mca_spml_ucx = { |
80 | 77 | .num_disconnect = 1, |
81 | 78 | .heap_reg_nb = 0, |
82 | 79 | .enabled = 0, |
83 | | - .get_mkey_slow = mca_spml_ucx_get_mkey_slow |
| 80 | + .get_mkey_slow = NULL |
84 | 81 | }; |
85 | 82 |
|
86 | 83 | 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) |
313 | 310 |
|
314 | 311 | } |
315 | 312 |
|
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 | | - |
347 | 313 | void mca_spml_ucx_rmkey_free(sshmem_mkey_t *mkey) |
348 | 314 | { |
349 | 315 | spml_ucx_mkey_t *ucx_mkey; |
@@ -595,24 +561,19 @@ int mca_spml_ucx_ctx_create(long options, shmem_ctx_t *ctx) |
595 | 561 | } |
596 | 562 |
|
597 | 563 | 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); |
599 | 574 | } |
600 | 575 | } |
601 | 576 |
|
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 | | - |
616 | 577 | SHMEM_MUTEX_LOCK(mca_spml_ucx.internal_mutex); |
617 | 578 |
|
618 | 579 | opal_list_append(&(mca_spml_ucx.ctx_list), &ctx_item->super); |
|
0 commit comments