@@ -254,7 +254,7 @@ static int send_cb(ompi_request_t * req)
254
254
(send_context -> buff , send_count , send_context -> con -> datatype ,
255
255
send_context -> peer ,
256
256
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 ));
258
258
if (MPI_SUCCESS != err ) {
259
259
return err ;
260
260
}
@@ -272,7 +272,8 @@ static int send_cb(ompi_request_t * req)
272
272
context -> con -> rank , context -> con -> tree -> tree_root , num_sent ,
273
273
context -> con -> num_segs ));
274
274
/* 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 ) {
276
277
ireduce_request_fini (context );
277
278
} else {
278
279
OBJ_RELEASE (context -> con );
@@ -436,7 +437,7 @@ static int recv_cb(ompi_request_t * req)
436
437
err = MCA_PML_CALL (isend (send_context -> buff , send_count , send_context -> con -> datatype ,
437
438
send_context -> peer ,
438
439
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 ));
440
441
if (MPI_SUCCESS != err ) {
441
442
return err ;
442
443
}
@@ -462,8 +463,8 @@ static int recv_cb(ompi_request_t * req)
462
463
(opal_free_list_item_t * ) context -> inbuf );
463
464
}
464
465
/* 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 ) ) {
467
468
ireduce_request_fini (context );
468
469
} else {
469
470
OBJ_RELEASE (context -> con );
@@ -771,7 +772,7 @@ int ompi_coll_adapt_ireduce_generic(const void *sbuf, void *rbuf, int count,
771
772
err = MCA_PML_CALL (isend
772
773
(context -> buff , send_count , dtype , tree -> tree_prev ,
773
774
con -> ireduce_tag - context -> frag_id ,
774
- MCA_PML_BASE_SEND_SYNCHRONOUS , comm , & send_req ));
775
+ MCA_PML_BASE_SEND_STANDARD , comm , & send_req ));
775
776
if (MPI_SUCCESS != err ) {
776
777
return err ;
777
778
}
0 commit comments