@@ -35,7 +35,7 @@ int ompi_request_default_test(ompi_request_t ** rptr,
35
35
#if OPAL_ENABLE_PROGRESS_THREADS == 0
36
36
int do_it_once = 0 ;
37
37
38
- recheck_request_status :
38
+ recheck_request_status :
39
39
#endif
40
40
opal_atomic_mb ();
41
41
if ( request -> req_state == OMPI_REQUEST_INACTIVE ) {
@@ -94,9 +94,10 @@ int ompi_request_default_test(ompi_request_t ** rptr,
94
94
* If we run the opal_progress then check the status of the request before
95
95
* leaving. We will call the opal_progress only once per call.
96
96
*/
97
- opal_progress ();
98
- do_it_once ++ ;
99
- goto recheck_request_status ;
97
+ ++ do_it_once ;
98
+ if (0 != opal_progress ()) {
99
+ goto recheck_request_status ;
100
+ }
100
101
}
101
102
#endif
102
103
* completed = false;
@@ -201,15 +202,15 @@ int ompi_request_default_test_all(
201
202
ompi_request_t * * rptr ;
202
203
size_t num_completed = 0 ;
203
204
ompi_request_t * request ;
205
+ int do_it_once = 0 ;
204
206
205
207
opal_atomic_mb ();
206
- rptr = requests ;
207
- for (i = 0 ; i < count ; i ++ , rptr ++ ) {
208
- request = * rptr ;
208
+ for (i = 0 ; i < count ; i ++ ) {
209
+ request = requests [i ];
209
210
210
- if ( request -> req_state == OMPI_REQUEST_INACTIVE ||
211
- REQUEST_COMPLETE (request ) ) {
211
+ if ( request -> req_state == OMPI_REQUEST_INACTIVE || REQUEST_COMPLETE (request ) ) {
212
212
num_completed ++ ;
213
+ continue ;
213
214
}
214
215
#if OPAL_ENABLE_FT_MPI
215
216
/* Check for dead requests due to process failure */
@@ -224,13 +225,22 @@ int ompi_request_default_test_all(
224
225
return MPI_ERR_PROC_FAILED_PENDING ;
225
226
}
226
227
#endif /* OPAL_ENABLE_FT_MPI */
228
+ #if OPAL_ENABLE_PROGRESS_THREADS == 0
229
+ if (0 == do_it_once ) {
230
+ ++ do_it_once ;
231
+ if (0 != opal_progress ()) {
232
+ /* continue walking the list, retest the current request */
233
+ -- i ;
234
+ continue ;
235
+ }
236
+ }
237
+ #endif /* OPAL_ENABLE_PROGRESS_THREADS */
238
+ /* short-circuit */
239
+ break ;
227
240
}
228
241
229
242
if (num_completed != count ) {
230
243
* completed = false;
231
- #if OPAL_ENABLE_PROGRESS_THREADS == 0
232
- opal_progress ();
233
- #endif
234
244
return OMPI_SUCCESS ;
235
245
}
236
246
@@ -336,6 +346,7 @@ int ompi_request_default_test_some(
336
346
}
337
347
if ( REQUEST_COMPLETE (request ) ) {
338
348
indices [num_requests_done ++ ] = i ;
349
+ continue ;
339
350
}
340
351
#if OPAL_ENABLE_FT_MPI
341
352
/* Check for dead requests due to process failure */
0 commit comments