Skip to content

Commit 9b2ed1e

Browse files
committed
osc/rdma: remove extra retain on fop
This commit fixes a resource leak when using network atomics. There was a leak when the underlying BTL did not support the attempted atomic. Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
1 parent 2fb5f55 commit 9b2ed1e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

ompi/mca/osc/rdma/osc_rdma_accumulate.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ static int ompi_osc_rdma_fetch_and_op_atomic (ompi_osc_rdma_sync_t *sync, const
149149
}
150150

151151
btl_op = ompi_osc_rdma_op_mapping[op->op_type];
152-
if (0 == btl_op) {
153-
return OMPI_ERR_NOT_SUPPORTED;
154-
}
155152

156153
flags = (4 == extent) ? MCA_BTL_ATOMIC_FLAG_32BIT : 0;
157154
if (OMPI_DATATYPE_FLAG_DATA_FLOAT & dt->super.flags) {

ompi/mca/osc/rdma/osc_rdma_lock.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/*
33
* Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights
44
* reserved.
5+
* Copyright (c) 2019 Triad National Security, LLC. All rights
6+
* reserved.
57
* $COPYRIGHT$
68
*
79
* Additional copyrights may follow
@@ -85,10 +87,10 @@ static inline int ompi_osc_rdma_btl_fop (ompi_osc_rdma_module_t *module, struct
8587
ret = OMPI_SUCCESS;
8688
ompi_osc_rdma_atomic_complete (module->selected_btl, endpoint, pending_op->op_buffer,
8789
pending_op->op_frag->handle, (void *) pending_op, NULL, OPAL_SUCCESS);
90+
} else {
91+
/* need to release here because ompi_osc_rdma_atomic_complete was not called */
92+
OBJ_RELEASE(pending_op);
8893
}
89-
90-
/* need to release here because ompi_osc_rdma_atomic_complet was not called */
91-
OBJ_RELEASE(pending_op);
9294
} else if (wait_for_completion) {
9395
while (!pending_op->op_complete) {
9496
ompi_osc_rdma_progress (module);
@@ -151,7 +153,7 @@ static inline int ompi_osc_rdma_btl_op (ompi_osc_rdma_module_t *module, struct m
151153
} while (1);
152154

153155
if (OPAL_SUCCESS != ret) {
154-
/* need to release here because ompi_osc_rdma_atomic_complet was not called */
156+
/* need to release here because ompi_osc_rdma_atomic_complete was not called */
155157
OBJ_RELEASE(pending_op);
156158
if (OPAL_LIKELY(1 == ret)) {
157159
if (cbfunc) {

0 commit comments

Comments
 (0)