Skip to content

Commit 7fced6c

Browse files
committed
cleanup: patch the coll libnbc to free data arrays
irrespective of types of datatyps feed into non-blocking/persistent alltoallw. We'll replace this with something better in a separate PR. Signed-off-by: Howard Pritchard <[email protected]>
1 parent 4a10921 commit 7fced6c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ompi/mca/coll/libnbc/coll_libnbc.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,18 +139,37 @@ OBJ_CLASS_DECLARATION(ompi_coll_libnbc_request_t);
139139
typedef ompi_coll_libnbc_request_t NBC_Handle;
140140

141141

142+
/*
143+
* TODO: want to do something better about release arrays at some point
144+
*/
142145
#define OMPI_COLL_LIBNBC_REQUEST_ALLOC(comm, persistent, req) \
143146
do { \
144147
opal_free_list_item_t *item; \
145148
item = opal_free_list_wait (&mca_coll_libnbc_component.requests); \
146149
req = (ompi_coll_libnbc_request_t*) item; \
147150
OMPI_REQUEST_INIT(&req->super.super, persistent); \
148151
req->super.super.req_mpi_object.comm = comm; \
152+
ompi_coll_base_nbc_request_t *nbc_req = \
153+
(ompi_coll_base_nbc_request_t *)req; \
154+
for(int i = 0; i < OMPI_REQ_NB_RELEASE_ARRAYS; i++ ) { \
155+
nbc_req->data.release_arrays[i] = NULL; \
156+
} \
149157
} while (0)
150158

159+
/*
160+
* TODO: want to do something better about release arrays at some point
161+
*/
151162
#define OMPI_COLL_LIBNBC_REQUEST_RETURN(req) \
152163
do { \
153164
OMPI_REQUEST_FINI(&(req)->super.super); \
165+
ompi_coll_base_nbc_request_t *nbc_req = \
166+
(ompi_coll_base_nbc_request_t *)(req); \
167+
for(int i = 0; i < OMPI_REQ_NB_RELEASE_ARRAYS; i++ ) { \
168+
if (NULL != nbc_req->data.release_arrays[i]) { \
169+
free(nbc_req->data.release_arrays[i]); \
170+
nbc_req->data.release_arrays[i] = NULL; \
171+
} \
172+
} \
154173
opal_free_list_return (&mca_coll_libnbc_component.requests, \
155174
(opal_free_list_item_t*) (req)); \
156175
} while (0)

0 commit comments

Comments
 (0)