Skip to content

Commit a422154

Browse files
committed
oshmem: mem use hook: apply code review fixes
Signed-off-by: Alex Mikheev <[email protected]>
1 parent cf74c5d commit a422154

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
@@ -288,7 +288,7 @@ int mca_spml_ucx_add_procs(ompi_proc_t **procs, size_t nprocs)
288288
&ep_params,
289289
&mca_spml_ucx.ucp_peers[i].ucp_conn);
290290
if (UCS_OK != err) {
291-
SPML_ERROR("ucp_ep_create failed: %s\n", ucs_status_string(err));
291+
SPML_ERROR("ucp_ep_create failed: %s", ucs_status_string(err));
292292
goto error2;
293293
}
294294
OSHMEM_PROC_DATA(procs[i])->num_transports = 1;
@@ -386,15 +386,16 @@ void mca_spml_ucx_rmkey_unpack(sshmem_mkey_t *mkey, uint32_t segno, int pe, int
386386

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

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

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

400401
params.field_mask = UCP_MEM_ADVISE_PARAM_FIELD_ADDRESS |
@@ -567,7 +568,7 @@ int mca_spml_ucx_fence(void)
567568

568569
err = ucp_worker_flush(mca_spml_ucx.ucp_worker);
569570
if (UCS_OK != err) {
570-
SPML_ERROR("fence failed: %s", ucs_status_string(err));
571+
SPML_ERROR("fence failed: %s", ucs_status_string(err));
571572
oshmem_shmem_abort(-1);
572573
return OSHMEM_ERROR;
573574
}
@@ -580,7 +581,7 @@ int mca_spml_ucx_quiet(void)
580581

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

0 commit comments

Comments
 (0)