Skip to content

Commit 6c0a2d1

Browse files
committed
portals4: use PtlHandleIsEqual() to compare handles
The Portals4 standard requires the use of PtlHandleIsEqual() instead of the (in)equality operatror, because a handle may be a compound data type that cannot be directly compared. Signed-off-by: Todd Kordenbrock <[email protected]>
1 parent 20b900e commit 6c0a2d1

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ompi/mca/osc/portals4/osc_portals4_comm.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ get_to_iovec(ompi_osc_portals4_module_t *module,
496496
ptrdiff_t length, origin_lb, target_lb, extent;
497497
ptl_md_t md;
498498

499-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
499+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
500500
PtlMDRelease(module->origin_iovec_md_h);
501501
free(module->origin_iovec_list);
502502
module->origin_iovec_md_h = PTL_INVALID_HANDLE;
@@ -583,7 +583,7 @@ atomic_get_to_iovec(ompi_osc_portals4_module_t *module,
583583
ptrdiff_t length, origin_lb, target_lb, extent;
584584
ptl_md_t md;
585585

586-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
586+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
587587
PtlMDRelease(module->origin_iovec_md_h);
588588
free(module->origin_iovec_list);
589589
module->origin_iovec_md_h = PTL_INVALID_HANDLE;
@@ -665,7 +665,7 @@ put_from_iovec(ompi_osc_portals4_module_t *module,
665665
ptrdiff_t length, origin_lb, target_lb, extent;
666666
ptl_md_t md;
667667

668-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
668+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
669669
PtlMDRelease(module->origin_iovec_md_h);
670670
free(module->origin_iovec_list);
671671
module->origin_iovec_md_h = PTL_INVALID_HANDLE;
@@ -754,7 +754,7 @@ atomic_put_from_iovec(ompi_osc_portals4_module_t *module,
754754
ptrdiff_t length, origin_lb, target_lb, extent;
755755
ptl_md_t md;
756756

757-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
757+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
758758
PtlMDRelease(module->origin_iovec_md_h);
759759
free(module->origin_iovec_list);
760760
module->origin_iovec_md_h = PTL_INVALID_HANDLE;
@@ -841,7 +841,7 @@ atomic_from_iovec(ompi_osc_portals4_module_t *module,
841841
ptl_op_t ptl_op;
842842
ptl_datatype_t ptl_dt;
843843

844-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
844+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
845845
PtlMDRelease(module->origin_iovec_md_h);
846846
free(module->origin_iovec_list);
847847
module->origin_iovec_md_h = PTL_INVALID_HANDLE;
@@ -940,7 +940,7 @@ swap_to_iovec(ompi_osc_portals4_module_t *module,
940940
ptl_md_t md;
941941
ptl_datatype_t ptl_dt;
942942

943-
if (module->result_iovec_md_h != PTL_INVALID_HANDLE) {
943+
if (!PtlHandleIsEqual(module->result_iovec_md_h,PTL_INVALID_HANDLE)) {
944944
PtlMDRelease(module->result_iovec_md_h);
945945
free(module->result_iovec_list);
946946
module->result_iovec_md_h = PTL_INVALID_HANDLE;
@@ -971,7 +971,7 @@ swap_to_iovec(ompi_osc_portals4_module_t *module,
971971
return ret;
972972
}
973973

974-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
974+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
975975
PtlMDRelease(module->origin_iovec_md_h);
976976
free(module->origin_iovec_list);
977977
module->origin_iovec_md_h = PTL_INVALID_HANDLE;
@@ -1066,7 +1066,7 @@ fetch_atomic_to_iovec(ompi_osc_portals4_module_t *module,
10661066
ptl_op_t ptl_op;
10671067
ptl_datatype_t ptl_dt;
10681068

1069-
if (module->result_iovec_md_h != PTL_INVALID_HANDLE) {
1069+
if (!PtlHandleIsEqual(module->result_iovec_md_h,PTL_INVALID_HANDLE)) {
10701070
PtlMDRelease(module->result_iovec_md_h);
10711071
free(module->result_iovec_list);
10721072
module->result_iovec_md_h = PTL_INVALID_HANDLE;
@@ -1097,7 +1097,7 @@ fetch_atomic_to_iovec(ompi_osc_portals4_module_t *module,
10971097
return ret;
10981098
}
10991099

1100-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
1100+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
11011101
PtlMDRelease(module->origin_iovec_md_h);
11021102
free(module->origin_iovec_list);
11031103
module->origin_iovec_md_h = PTL_INVALID_HANDLE;

ompi/mca/osc/portals4/osc_portals4_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,11 @@ ompi_osc_portals4_free(struct ompi_win_t *win)
655655
PtlMEUnlink(module->control_me_h);
656656
PtlMEUnlink(module->data_me_h);
657657
PtlMDRelease(module->md_h);
658-
if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) {
658+
if (!PtlHandleIsEqual(module->origin_iovec_md_h,PTL_INVALID_HANDLE)) {
659659
PtlMDRelease(module->origin_iovec_md_h);
660660
free(module->origin_iovec_list);
661661
}
662-
if (module->result_iovec_md_h != PTL_INVALID_HANDLE) {
662+
if (!PtlHandleIsEqual(module->result_iovec_md_h,PTL_INVALID_HANDLE)) {
663663
PtlMDRelease(module->result_iovec_md_h);
664664
free(module->result_iovec_list);
665665
}

opal/mca/btl/portals4/btl_portals4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,13 @@ int mca_btl_portals4_free(struct mca_btl_base_module_t *btl_base, mca_btl_base_d
487487
OPAL_BTL_PORTALS4_FRAG_RETURN_EAGER(portals4_btl, frag);
488488

489489
} else if (BTL_PORTALS4_FRAG_TYPE_MAX == frag->type) {
490-
if (frag->me_h != PTL_INVALID_HANDLE) {
490+
if (!PtlHandleIsEqual(frag->me_h,PTL_INVALID_HANDLE)) {
491491
frag->me_h = PTL_INVALID_HANDLE;
492492
}
493493
OPAL_BTL_PORTALS4_FRAG_RETURN_MAX(portals4_btl, frag);
494494

495495
} else if (BTL_PORTALS4_FRAG_TYPE_USER == frag->type) {
496-
if (frag->me_h != PTL_INVALID_HANDLE) {
496+
if (!PtlHandleIsEqual(frag->me_h,PTL_INVALID_HANDLE)) {
497497
frag->me_h = PTL_INVALID_HANDLE;
498498
}
499499
OPAL_THREAD_ADD_FETCH32(&portals4_btl->portals_outstanding_ops, -1);

0 commit comments

Comments
 (0)