@@ -77,13 +77,29 @@ int ompi_request_default_wait(
7777 if ( MPI_STATUS_IGNORE != status ) {
7878 OMPI_COPY_STATUS (status , req -> req_status , false);
7979 }
80+
81+ #if OMPI_HAVE_MPI_EXT_CONTINUE
82+ if (OMPI_REQUEST_CONT == req -> req_type ) {
83+ /* continuation requests are alwys active, don't modify the state */
84+ return req -> req_status .MPI_ERROR ;
85+ }
86+ #endif // OMPI_HAVE_MPI_EXT_CONTINUE
87+
8088 if ( req -> req_persistent ) {
8189 if ( req -> req_state == OMPI_REQUEST_INACTIVE ) {
8290 if (MPI_STATUS_IGNORE != status ) {
8391 OMPI_COPY_STATUS (status , ompi_status_empty , false);
8492 }
8593 return OMPI_SUCCESS ;
8694 }
95+
96+ #if OMPI_HAVE_MPI_EXT_CONTINUE
97+ if (OMPI_REQUEST_CONT == req -> req_type ) {
98+ /* continuation requests are alwys active, don't modify the state */
99+ return req -> req_status .MPI_ERROR ;
100+ }
101+ #endif // OMPI_HAVE_MPI_EXT_CONTINUE
102+
87103 req -> req_state = OMPI_REQUEST_INACTIVE ;
88104 return req -> req_status .MPI_ERROR ;
89105 }
@@ -220,7 +236,7 @@ int ompi_request_default_wait_any(size_t count,
220236 if ( * index == (int )completed ) {
221237 /* Only one request has triggered. There was no in-flight
222238 * completions. Drop the signalled flag so we won't block
223- * in WAIT_SYNC_RELEASE
239+ * in WAIT_SYNC_RELEASE
224240 */
225241 WAIT_SYNC_SIGNALLED (& sync );
226242 }
@@ -244,7 +260,14 @@ int ompi_request_default_wait_any(size_t count,
244260 }
245261 rc = request -> req_status .MPI_ERROR ;
246262 if ( request -> req_persistent ) {
263+ #if OMPI_HAVE_MPI_EXT_CONTINUE
264+ if (OMPI_REQUEST_CONT != request -> req_type ) {
265+ request -> req_state = OMPI_REQUEST_INACTIVE ;
266+ }
267+ #else // OMPI_HAVE_MPI_EXT_CONTINUE
247268 request -> req_state = OMPI_REQUEST_INACTIVE ;
269+ #endif // OMPI_HAVE_MPI_EXT_CONTINUE
270+
248271 } else if (MPI_SUCCESS == rc ) {
249272 /* Only free the request if there is no error on it */
250273 /* If there's an error while freeing the request,
@@ -400,6 +423,14 @@ int ompi_request_default_wait_all( size_t count,
400423
401424 OMPI_COPY_STATUS (& statuses [i ], request -> req_status , true);
402425
426+
427+ #if OMPI_HAVE_MPI_EXT_CONTINUE
428+ if (OMPI_REQUEST_CONT == request -> req_type ) {
429+ /* continuation requests are alwys active, don't modify the state */
430+ continue ;
431+ }
432+ #endif // OMPI_HAVE_MPI_EXT_CONTINUE
433+
403434 if ( request -> req_persistent ) {
404435 request -> req_state = OMPI_REQUEST_INACTIVE ;
405436 continue ;
@@ -471,6 +502,13 @@ int ompi_request_default_wait_all( size_t count,
471502
472503 rc = request -> req_status .MPI_ERROR ;
473504
505+ #if OMPI_HAVE_MPI_EXT_CONTINUE
506+ if (OMPI_REQUEST_CONT == request -> req_type ) {
507+ /* continuation requests are alwys active, don't modify the state */
508+ continue ;
509+ }
510+ #endif // OMPI_HAVE_MPI_EXT_CONTINUE
511+
474512 if ( request -> req_persistent ) {
475513 request -> req_state = OMPI_REQUEST_INACTIVE ;
476514 } else if (MPI_SUCCESS == rc ) {
@@ -602,14 +640,14 @@ int ompi_request_default_wait_some(size_t count,
602640 * a) request was found completed in the first loop
603641 * => ( indices[i] == 0 )
604642 * b) request was completed between first loop and this check
605- * => ( indices[i] == 1 ) and we can NOT atomically mark the
643+ * => ( indices[i] == 1 ) and we can NOT atomically mark the
606644 * request as pending.
607645 * c) request wasn't finished yet
608- * => ( indices[i] == 1 ) and we CAN atomically mark the
646+ * => ( indices[i] == 1 ) and we CAN atomically mark the
609647 * request as pending.
610648 * NOTE that in any case (i >= num_requests_done) as latter grows
611649 * either slowly (in case of partial completion)
612- * OR in parallel with `i` (in case of full set completion)
650+ * OR in parallel with `i` (in case of full set completion)
613651 */
614652 if ( !indices [num_active_reqs ] ) {
615653 indices [num_requests_done ++ ] = i ;
@@ -679,6 +717,13 @@ int ompi_request_default_wait_some(size_t count,
679717 rc = MPI_ERR_IN_STATUS ;
680718 }
681719
720+ #if OMPI_HAVE_MPI_EXT_CONTINUE
721+ if (OMPI_REQUEST_CONT == request -> req_type ) {
722+ /* continuation requests are alwys active, don't modify the state */
723+ continue ;
724+ }
725+ #endif // OMPI_HAVE_MPI_EXT_CONTINUE
726+
682727 if ( request -> req_persistent ) {
683728 request -> req_state = OMPI_REQUEST_INACTIVE ;
684729 } else {
0 commit comments