Skip to content

Commit a937f29

Browse files
committed
Reorder progress of individual requests
Explicit global progress instead of global progress when progressing a request, to avoid recursive progress calls. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
1 parent 0d49c87 commit a937f29

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

ompi/mpiext/continue/c/continuation.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ int ompi_continue_progress_request_n(ompi_cont_request_t *cont_req, uint32_t max
355355
{
356356
if (tld->in_progress) return 0;
357357
if (NULL == cont_req->cont_complete_list) {
358-
/* progress as many as allowed */
359-
return ompi_continue_progress_n(cont_req->continue_max_poll, tld);
358+
/* nothing to progress in this request */
359+
return 0;
360360
}
361361
if (opal_list_is_empty(cont_req->cont_complete_list)) {
362362
return 0;
@@ -405,6 +405,10 @@ int ompi_continue_progress_request(ompi_request_t *req)
405405
thread_local_data_t *tld = get_tl_data();
406406
ompi_cont_request_t *cont_req = (ompi_cont_request_t *)req;
407407
int rc = ompi_continue_progress_request_n(cont_req, cont_req->continue_max_poll, tld);
408+
/* global progress, if the request isn't complete yet */
409+
if (!REQUEST_COMPLETE(req)) {
410+
rc += ompi_continue_progress_n(cont_req->continue_max_poll - rc, tld);
411+
}
408412
return rc;
409413
}
410414

@@ -418,22 +422,29 @@ int ompi_continue_register_request_progress(ompi_request_t *req, ompi_wait_sync_
418422

419423
thread_local_data_t *tld = get_tl_data();
420424

421-
if (REQUEST_COMPLETE(&cont_req->super)) {
422-
return OMPI_SUCCESS;
423-
}
424-
425425
if (NULL == cont_req->cont_complete_list) {
426-
/* progress requests to see if we can complete it already */
427-
ompi_continue_progress_n(UINT32_MAX, tld);
428-
return OMPI_SUCCESS;
426+
if (!REQUEST_COMPLETE(&cont_req->super)) {
427+
/* progress requests to see if we can complete it already */
428+
ompi_continue_progress_n(UINT32_MAX, tld);
429+
}
430+
431+
return OMPI_SUCCESS;
429432
}
430433

431434
/* add the continuation request to the thread-local list,
432435
* will be removed in ompi_continue_deregister_request_progress */
433436
opal_list_append(&tld->thread_progress_list, &cont_req->super.super.super);
434437

438+
if (REQUEST_COMPLETE(&cont_req->super)) {
439+
return OMPI_SUCCESS;
440+
}
441+
435442
/* progress request to see if we can complete it already */
436-
ompi_continue_progress_request_n(cont_req, cont_req->continue_max_poll, tld);
443+
ompi_continue_progress_request_n(cont_req, UINT32_MAX, tld);
444+
445+
if (!REQUEST_COMPLETE(req)) {
446+
ompi_continue_progress_n(UINT32_MAX, tld);
447+
}
437448

438449
if (REQUEST_COMPLETE(req)) return OMPI_SUCCESS;
439450

0 commit comments

Comments
 (0)