@@ -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 ) {
@@ -86,9 +86,10 @@ int ompi_request_default_test(ompi_request_t ** rptr,
86
86
* If we run the opal_progress then check the status of the request before
87
87
* leaving. We will call the opal_progress only once per call.
88
88
*/
89
- opal_progress ();
90
- do_it_once ++ ;
91
- goto recheck_request_status ;
89
+ ++ do_it_once ;
90
+ if (0 != opal_progress ()) {
91
+ goto recheck_request_status ;
92
+ }
92
93
}
93
94
#endif
94
95
* completed = false;
@@ -183,15 +184,15 @@ int ompi_request_default_test_all(
183
184
ompi_request_t * * rptr ;
184
185
size_t num_completed = 0 ;
185
186
ompi_request_t * request ;
187
+ int do_it_once = 0 ;
186
188
187
189
opal_atomic_mb ();
188
- rptr = requests ;
189
- for (i = 0 ; i < count ; i ++ , rptr ++ ) {
190
- request = * rptr ;
190
+ for (i = 0 ; i < count ; i ++ ) {
191
+ request = requests [i ];
191
192
192
- if ( request -> req_state == OMPI_REQUEST_INACTIVE ||
193
- REQUEST_COMPLETE (request ) ) {
193
+ if ( request -> req_state == OMPI_REQUEST_INACTIVE || REQUEST_COMPLETE (request ) ) {
194
194
num_completed ++ ;
195
+ continue ;
195
196
}
196
197
#if OPAL_ENABLE_FT_MPI
197
198
/* Check for dead requests due to process failure */
@@ -206,13 +207,22 @@ int ompi_request_default_test_all(
206
207
return MPI_ERR_PROC_FAILED_PENDING ;
207
208
}
208
209
#endif /* OPAL_ENABLE_FT_MPI */
210
+ #if OPAL_ENABLE_PROGRESS_THREADS == 0
211
+ if (0 == do_it_once ) {
212
+ ++ do_it_once ;
213
+ if (0 != opal_progress ()) {
214
+ /* continue walking the list, retest the current request */
215
+ -- i ;
216
+ continue ;
217
+ }
218
+ }
219
+ #endif /* OPAL_ENABLE_PROGRESS_THREADS */
220
+ /* short-circuit */
221
+ break ;
209
222
}
210
223
211
224
if (num_completed != count ) {
212
225
* completed = false;
213
- #if OPAL_ENABLE_PROGRESS_THREADS == 0
214
- opal_progress ();
215
- #endif
216
226
return OMPI_SUCCESS ;
217
227
}
218
228
@@ -318,6 +328,7 @@ int ompi_request_default_test_some(
318
328
}
319
329
if ( REQUEST_COMPLETE (request ) ) {
320
330
indices [num_requests_done ++ ] = i ;
331
+ continue ;
321
332
}
322
333
#if OPAL_ENABLE_FT_MPI
323
334
/* Check for dead requests due to process failure */
0 commit comments