Skip to content

Commit 506cda1

Browse files
bosilcadevreal
andauthored
ADAPT: use standard instead of synchronous send (#33)
Signed-off-by: Joseph Schuchart <[email protected]> Co-authored-by: Joseph Schuchart <[email protected]>
1 parent 5609bf3 commit 506cda1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ompi/mca/coll/adapt/coll_adapt_ireduce.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static int send_cb(ompi_request_t * req)
254254
(send_context->buff, send_count, send_context->con->datatype,
255255
send_context->peer,
256256
context->con->ireduce_tag - send_context->frag_id,
257-
MCA_PML_BASE_SEND_SYNCHRONOUS, send_context->con->comm, &send_req));
257+
MCA_PML_BASE_SEND_STANDARD, send_context->con->comm, &send_req));
258258
if (MPI_SUCCESS != err) {
259259
return err;
260260
}
@@ -272,7 +272,8 @@ static int send_cb(ompi_request_t * req)
272272
context->con->rank, context->con->tree->tree_root, num_sent,
273273
context->con->num_segs));
274274
/* Check whether signal the condition, non root and sent all the segments */
275-
if (context->con->tree->tree_root != context->con->rank && num_sent == context->con->num_segs) {
275+
if (num_sent == context->con->num_segs &&
276+
context->con->num_recv_segs == context->con->num_segs * context->con->tree->tree_nextsize) {
276277
ireduce_request_fini(context);
277278
} else {
278279
OBJ_RELEASE(context->con);
@@ -436,7 +437,7 @@ static int recv_cb(ompi_request_t * req)
436437
err = MCA_PML_CALL(isend(send_context->buff, send_count, send_context->con->datatype,
437438
send_context->peer,
438439
send_context->con->ireduce_tag - send_context->frag_id,
439-
MCA_PML_BASE_SEND_SYNCHRONOUS, send_context->con->comm, &send_req));
440+
MCA_PML_BASE_SEND_STANDARD, send_context->con->comm, &send_req));
440441
if (MPI_SUCCESS != err) {
441442
return err;
442443
}
@@ -462,8 +463,8 @@ static int recv_cb(ompi_request_t * req)
462463
(opal_free_list_item_t *) context->inbuf);
463464
}
464465
/* If this is root and has received all the segments */
465-
if (context->con->tree->tree_root == context->con->rank
466-
&& num_recv_segs == context->con->num_segs * context->con->tree->tree_nextsize) {
466+
if (num_recv_segs == context->con->num_segs * context->con->tree->tree_nextsize &&
467+
(context->con->tree->tree_root == context->con->rank || context->con->num_sent_segs == context->con->num_segs)) {
467468
ireduce_request_fini(context);
468469
} else {
469470
OBJ_RELEASE(context->con);
@@ -771,7 +772,7 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
771772
err = MCA_PML_CALL(isend
772773
(context->buff, send_count, dtype, tree->tree_prev,
773774
con->ireduce_tag - context->frag_id,
774-
MCA_PML_BASE_SEND_SYNCHRONOUS, comm, &send_req));
775+
MCA_PML_BASE_SEND_STANDARD, comm, &send_req));
775776
if (MPI_SUCCESS != err) {
776777
return err;
777778
}

0 commit comments

Comments
 (0)