Skip to content

Commit 8b6f2d9

Browse files
authored
Merge pull request #6930 from vspetrov/coll_hcoll_nbc_request_bugfix
Coll/hcoll: fixes hcoll non-blocking colls support
2 parents 71e1fad + a0d99ad commit 8b6f2d9

File tree

1 file changed

+19
-28
lines changed

1 file changed

+19
-28
lines changed

ompi/mca/coll/hcoll/coll_hcoll_rte.c

Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "ompi/datatype/ompi_datatype.h"
4040
#include "ompi/datatype/ompi_datatype_internal.h"
4141
#include "ompi/mca/pml/pml.h"
42-
42+
#include "ompi/mca/coll/base/coll_base_util.h"
4343

4444
#include "hcoll/api/hcoll_dte.h"
4545
#include "hcoll/api/hcoll_api.h"
@@ -151,25 +151,13 @@ void hcoll_rte_fns_setup(void)
151151
{
152152
init_module_fns();
153153
OBJ_CONSTRUCT(&mca_coll_hcoll_component.requests, opal_free_list_t);
154-
opal_free_list_init(
155-
&(mca_coll_hcoll_component.requests),
156-
sizeof(ompi_request_t),
157-
/* no special alignment needed */
158-
8,
159-
OBJ_CLASS(ompi_request_t),
160-
/* no payload data */
161-
0, 0,
162-
/* NOTE: hack - need to parametrize this */
163-
10,
164-
-1,
165-
10,
166-
/* No Mpool or init function */
167-
NULL,
168-
0,
169-
NULL,
170-
NULL,
171-
NULL
172-
);
154+
opal_free_list_init(&(mca_coll_hcoll_component.requests),
155+
sizeof(ompi_coll_base_nbc_request_t),
156+
opal_cache_line_size, OBJ_CLASS(ompi_coll_base_nbc_request_t),
157+
/* no payload data */
158+
0, 0, 10, -1, 10,
159+
/* No Mpool or init function */
160+
NULL, 0, NULL, NULL, NULL);
173161
}
174162

175163
static int recv_nb(struct dte_data_representation_t data,
@@ -349,20 +337,23 @@ request_free(struct ompi_request_t **ompi_req)
349337

350338
static void* get_coll_handle(void)
351339
{
352-
ompi_request_t *ompi_req;
340+
ompi_coll_base_nbc_request_t *ompi_req;
353341
opal_free_list_item_t *item;
354342
item = opal_free_list_wait (&(mca_coll_hcoll_component.requests));
355343
if (OPAL_UNLIKELY(NULL == item)) {
356344
HCOL_ERROR("Wait for free list failed.\n");
357345
return NULL;
358346
}
359-
ompi_req = (ompi_request_t *)item;
360-
OMPI_REQUEST_INIT(ompi_req,false);
361-
ompi_req->req_complete_cb = NULL;
362-
ompi_req->req_status.MPI_ERROR = MPI_SUCCESS;
363-
ompi_req->req_state = OMPI_REQUEST_ACTIVE;
364-
ompi_req->req_free = request_free;
365-
ompi_req->req_type = OMPI_REQUEST_COLL;
347+
ompi_req = (ompi_coll_base_nbc_request_t *)item;
348+
OMPI_REQUEST_INIT(&ompi_req->super,false);
349+
ompi_req->super.req_complete_cb = NULL;
350+
ompi_req->super.req_complete_cb_data = NULL;
351+
ompi_req->super.req_status.MPI_ERROR = MPI_SUCCESS;
352+
ompi_req->super.req_state = OMPI_REQUEST_ACTIVE;
353+
ompi_req->super.req_free = request_free;
354+
ompi_req->super.req_type = OMPI_REQUEST_COLL;
355+
ompi_req->data.objs.objs[0] = NULL;
356+
ompi_req->data.objs.objs[1] = NULL;
366357
return (void *)ompi_req;
367358
}
368359

0 commit comments

Comments
 (0)