Skip to content

Commit ea3ea48

Browse files
committed
oshmem: mem use hook: apply code review fixes
Signed-off-by: Alex Mikheev <[email protected]> (cherry picked from commit a422154)
1 parent 9da9e62 commit ea3ea48

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

oshmem/mca/memheap/buddy/memheap_buddy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ static int _do_alloc(uint32_t order,
469469
}
470470

471471
*p_buff = (void*) addr;
472-
MCA_SPML_CALL(memuse_hook(addr, 1<<order));
472+
MCA_SPML_CALL(memuse_hook(*p_buff, 1ULL<<order));
473473
return OSHMEM_SUCCESS;
474474

475475
alloc_error: _buddy_free(&memheap_buddy, offset, order, heap);

oshmem/mca/spml/ucx/spml_ucx.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ int mca_spml_ucx_add_procs(ompi_proc_t** procs, size_t nprocs)
289289
&ep_params,
290290
&mca_spml_ucx.ucp_peers[i].ucp_conn);
291291
if (UCS_OK != err) {
292-
SPML_ERROR("ucp_ep_create failed: %s\n", ucs_status_string(err));
292+
SPML_ERROR("ucp_ep_create failed: %s", ucs_status_string(err));
293293
goto error2;
294294
}
295295
OSHMEM_PROC_DATA(procs[i])->num_transports = 1;
@@ -387,15 +387,16 @@ void mca_spml_ucx_rmkey_unpack(sshmem_mkey_t *mkey, uint32_t segno, int pe, int
387387

388388
void mca_spml_ucx_memuse_hook(void *addr, size_t length)
389389
{
390-
int my_pe = oshmem_my_proc_id();
391-
spml_ucx_mkey_t *ucx_mkey;
390+
int my_pe;
391+
spml_ucx_mkey_t *ucx_mkey;
392392
ucp_mem_advise_params_t params;
393393
ucs_status_t status;
394394

395395
if (!(mca_spml_ucx.heap_reg_nb && memheap_is_va_in_segment(addr, HEAP_SEG_INDEX))) {
396396
return;
397397
}
398398

399+
my_pe = oshmem_my_proc_id();
399400
ucx_mkey = &mca_spml_ucx.ucp_peers[my_pe].mkeys[HEAP_SEG_INDEX].key;
400401

401402
params.field_mask = UCP_MEM_ADVISE_PARAM_FIELD_ADDRESS |
@@ -568,7 +569,7 @@ int mca_spml_ucx_fence(void)
568569

569570
err = ucp_worker_flush(mca_spml_ucx.ucp_worker);
570571
if (UCS_OK != err) {
571-
SPML_ERROR("fence failed: %s", ucs_status_string(err));
572+
SPML_ERROR("fence failed: %s", ucs_status_string(err));
572573
oshmem_shmem_abort(-1);
573574
return OSHMEM_ERROR;
574575
}
@@ -581,7 +582,7 @@ int mca_spml_ucx_quiet(void)
581582

582583
err = ucp_worker_flush(mca_spml_ucx.ucp_worker);
583584
if (UCS_OK != err) {
584-
SPML_ERROR("fence failed: %s", ucs_status_string(err));
585+
SPML_ERROR("fence failed: %s", ucs_status_string(err));
585586
oshmem_shmem_abort(-1);
586587
return OSHMEM_ERROR;
587588
}

0 commit comments

Comments
 (0)