|
41 | 41 | #define SPML_UCX_PUT_DEBUG 0 |
42 | 42 | #endif |
43 | 43 |
|
44 | | -static |
45 | | -spml_ucx_mkey_t * mca_spml_ucx_get_mkey_slow(shmem_ctx_t ctx, int pe, void *va, void **rva); |
46 | | - |
47 | 44 | mca_spml_ucx_t mca_spml_ucx = { |
48 | 45 | .super = { |
49 | 46 | /* Init mca_spml_base_module_t */ |
@@ -77,7 +74,7 @@ mca_spml_ucx_t mca_spml_ucx = { |
77 | 74 | .num_disconnect = 1, |
78 | 75 | .heap_reg_nb = 0, |
79 | 76 | .enabled = 0, |
80 | | - .get_mkey_slow = mca_spml_ucx_get_mkey_slow |
| 77 | + .get_mkey_slow = NULL |
81 | 78 | }; |
82 | 79 |
|
83 | 80 | OBJ_CLASS_INSTANCE(mca_spml_ucx_ctx_list_item_t, opal_list_item_t, NULL, NULL); |
@@ -310,37 +307,6 @@ int mca_spml_ucx_add_procs(ompi_proc_t** procs, size_t nprocs) |
310 | 307 |
|
311 | 308 | } |
312 | 309 |
|
313 | | - |
314 | | -static |
315 | | -spml_ucx_mkey_t * mca_spml_ucx_get_mkey_slow(shmem_ctx_t ctx, int pe, void *va, void **rva) |
316 | | -{ |
317 | | - sshmem_mkey_t *r_mkey; |
318 | | - spml_ucx_mkey_t *ucx_mkey; |
319 | | - uint32_t segno; |
320 | | - mca_spml_ucx_ctx_t *ucx_ctx = (mca_spml_ucx_ctx_t *)ctx; |
321 | | - ucs_status_t err; |
322 | | - |
323 | | - r_mkey = mca_memheap_base_get_cached_mkey(ctx, pe, va, 0, rva); |
324 | | - if (OPAL_UNLIKELY(!r_mkey)) { |
325 | | - SPML_UCX_ERROR("pe=%d: %p is not address of symmetric variable", |
326 | | - pe, va); |
327 | | - oshmem_shmem_abort(-1); |
328 | | - return NULL; |
329 | | - } |
330 | | - |
331 | | - segno = memheap_find_segnum(va); |
332 | | - ucx_mkey = &ucx_ctx->ucp_peers[pe].mkeys[segno].key; |
333 | | - |
334 | | - if (ucx_mkey->rkey == NULL) { |
335 | | - err = ucp_ep_rkey_unpack(ucx_ctx->ucp_peers[pe].ucp_conn, |
336 | | - r_mkey->u.data, |
337 | | - &ucx_mkey->rkey); |
338 | | - mca_spml_ucx_cache_mkey(ucx_ctx, r_mkey, segno, pe); /* make sure it is properly cached */ |
339 | | - } |
340 | | - |
341 | | - return ucx_mkey; |
342 | | -} |
343 | | - |
344 | 310 | void mca_spml_ucx_rmkey_free(sshmem_mkey_t *mkey) |
345 | 311 | { |
346 | 312 | spml_ucx_mkey_t *ucx_mkey; |
@@ -592,24 +558,19 @@ int mca_spml_ucx_ctx_create(long options, shmem_ctx_t *ctx) |
592 | 558 | } |
593 | 559 |
|
594 | 560 | for (j = 0; j < MCA_MEMHEAP_SEG_COUNT; j++) { |
595 | | - ctx_item->ctx.ucp_peers[i].mkeys[j].key.rkey = NULL; |
| 561 | + mkey = &memheap_map->mem_segs[j].mkeys_cache[i][0]; |
| 562 | + ucx_mkey = &ctx_item->ctx.ucp_peers[i].mkeys[j].key; |
| 563 | + err = ucp_ep_rkey_unpack(ctx_item->ctx.ucp_peers[i].ucp_conn, |
| 564 | + mkey->u.data, |
| 565 | + &ucx_mkey->rkey); |
| 566 | + if (UCS_OK != err) { |
| 567 | + SPML_UCX_ERROR("failed to unpack rkey"); |
| 568 | + goto error2; |
| 569 | + } |
| 570 | + mca_spml_ucx_cache_mkey(&ctx_item->ctx, mkey, j, i); |
596 | 571 | } |
597 | 572 | } |
598 | 573 |
|
599 | | - for (i = 0; i < MCA_MEMHEAP_SEG_COUNT; i++) { |
600 | | - mkey = &memheap_map->mem_segs[i].mkeys_cache[my_pe][0]; |
601 | | - ucx_mkey = &ctx_item->ctx.ucp_peers[my_pe].mkeys[i].key; |
602 | | - err = ucp_ep_rkey_unpack(ctx_item->ctx.ucp_peers[my_pe].ucp_conn, |
603 | | - mkey->u.data, |
604 | | - &ucx_mkey->rkey); |
605 | | - if (UCS_OK != err) { |
606 | | - SPML_UCX_ERROR("failed to unpack rkey"); |
607 | | - goto error2; |
608 | | - } |
609 | | - |
610 | | - mca_spml_ucx_cache_mkey(&ctx_item->ctx, mkey, i, my_pe); |
611 | | - } |
612 | | - |
613 | 574 | SHMEM_MUTEX_LOCK(mca_spml_ucx.internal_mutex); |
614 | 575 |
|
615 | 576 | opal_list_append(&(mca_spml_ucx.ctx_list), &ctx_item->super); |
|
0 commit comments