From cefee2ea71382a5061cb45dec68dee883873fb20 Mon Sep 17 00:00:00 2001 From: Todd Kordenbrock Date: Tue, 30 Jul 2024 08:46:20 -0500 Subject: [PATCH] portals4: use PtlHandleIsEqual() to compare handles - more fixes Signed-off-by: Todd Kordenbrock --- ompi/mca/mtl/portals4/mtl_portals4_cancel.c | 2 +- ompi/mca/mtl/portals4/mtl_portals4_recv_short.c | 2 +- ompi/mca/osc/portals4/osc_portals4_component.c | 8 ++++---- opal/mca/btl/portals4/btl_portals4_frag.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ompi/mca/mtl/portals4/mtl_portals4_cancel.c b/ompi/mca/mtl/portals4/mtl_portals4_cancel.c index 1e2e5a43ddf..8994676046b 100644 --- a/ompi/mca/mtl/portals4/mtl_portals4_cancel.c +++ b/ompi/mca/mtl/portals4/mtl_portals4_cancel.c @@ -45,7 +45,7 @@ ompi_mtl_portals4_cancel(struct mca_mtl_base_module_t* mtl, receive completion event... */ ompi_mtl_portals4_progress(); - if (PTL_INVALID_HANDLE != recvreq->me_h) { + if (!PtlHandleIsEqual(recvreq->me_h, PTL_INVALID_HANDLE)) { ret = PtlMEUnlink(recvreq->me_h); if (PTL_OK == ret) { recvreq->super.super.ompi_req->req_status._cancelled = true; diff --git a/ompi/mca/mtl/portals4/mtl_portals4_recv_short.c b/ompi/mca/mtl/portals4/mtl_portals4_recv_short.c index 23cd049022b..d712338b498 100644 --- a/ompi/mca/mtl/portals4/mtl_portals4_recv_short.c +++ b/ompi/mca/mtl/portals4/mtl_portals4_recv_short.c @@ -162,7 +162,7 @@ ompi_mtl_portals4_recv_short_block_alloc(bool release_on_free) static int ompi_mtl_portals4_recv_short_block_free(ompi_mtl_portals4_recv_short_block_t *block) { - if (PTL_INVALID_HANDLE != block->me_h) { + if (!PtlHandleIsEqual(block->me_h, PTL_INVALID_HANDLE)) { PtlMEUnlink(block->me_h); block->me_h = PTL_INVALID_HANDLE; } diff --git a/ompi/mca/osc/portals4/osc_portals4_component.c b/ompi/mca/osc/portals4/osc_portals4_component.c index e2725b8af00..ee988c6f34b 100644 --- a/ompi/mca/osc/portals4/osc_portals4_component.c +++ b/ompi/mca/osc/portals4/osc_portals4_component.c @@ -615,10 +615,10 @@ component_select(struct ompi_win_t *win, void **base, size_t size, ptrdiff_t dis error: /* BWB: FIX ME: This is all wrong... */ - if (0 != module->ct_h) PtlCTFree(module->ct_h); - if (0 != module->data_me_h) PtlMEUnlink(module->data_me_h); - if (0 != module->req_md_h) PtlMDRelease(module->req_md_h); - if (0 != module->md_h) PtlMDRelease(module->md_h); + if (!PtlHandleIsEqual(module->ct_h, PTL_INVALID_HANDLE)) PtlCTFree(module->ct_h); + if (!PtlHandleIsEqual(module->data_me_h, PTL_INVALID_HANDLE)) PtlMEUnlink(module->data_me_h); + if (!PtlHandleIsEqual(module->req_md_h, PTL_INVALID_HANDLE)) PtlMDRelease(module->req_md_h); + if (!PtlHandleIsEqual(module->md_h, PTL_INVALID_HANDLE)) PtlMDRelease(module->md_h); if (NULL != module->comm) ompi_comm_free(&module->comm); if (NULL != module) free(module); diff --git a/opal/mca/btl/portals4/btl_portals4_frag.c b/opal/mca/btl/portals4/btl_portals4_frag.c index cbe765d0073..56df617a2c6 100644 --- a/opal/mca/btl/portals4/btl_portals4_frag.c +++ b/opal/mca/btl/portals4/btl_portals4_frag.c @@ -45,7 +45,7 @@ static void mca_btl_portals4_frag_eager_constructor(mca_btl_portals4_frag_t *fra static void mca_btl_portals4_frag_eager_destructor(mca_btl_portals4_frag_t *frag) { - if (PTL_INVALID_HANDLE != frag->me_h) { + if (!PtlHandleIsEqual(frag->me_h, PTL_INVALID_HANDLE)) { PtlMEUnlink(frag->me_h); frag->me_h = PTL_INVALID_HANDLE; }