1
1

Harmonize return values of progress callbacks

Signed-off-by: Joseph Schuchart <schuchart@hlrs.de>
Этот коммит содержится в:
Joseph Schuchart 2019-12-10 15:04:07 +01:00
родитель 1275766037
Коммит 2c97187ee0
6 изменённых файлов: 16 добавлений и 7 удалений

Просмотреть файл

@ -427,6 +427,7 @@ ompi_coll_libnbc_progress(void)
{ {
ompi_coll_libnbc_request_t* request, *next; ompi_coll_libnbc_request_t* request, *next;
int res; int res;
int completed = 0;
if (0 == opal_list_get_size (&mca_coll_libnbc_component.active_requests)) { if (0 == opal_list_get_size (&mca_coll_libnbc_component.active_requests)) {
/* no requests -- nothing to do. do not grab a lock */ /* no requests -- nothing to do. do not grab a lock */
@ -464,6 +465,7 @@ ompi_coll_libnbc_progress(void)
if(!request->super.super.req_persistent || !REQUEST_COMPLETE(&request->super.super)) { if(!request->super.super.req_persistent || !REQUEST_COMPLETE(&request->super.super)) {
ompi_request_complete(&request->super.super, true); ompi_request_complete(&request->super.super, true);
} }
completed++;
} }
OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock); OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock);
} }
@ -471,7 +473,7 @@ ompi_coll_libnbc_progress(void)
} }
OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock); OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock);
return 0; return completed;
} }

Просмотреть файл

@ -403,7 +403,7 @@ int ompi_mtl_psm2_progress( void ) {
mca_mtl_psm2_request_t* mtl_psm2_request; mca_mtl_psm2_request_t* mtl_psm2_request;
psm2_mq_status2_t psm2_status; psm2_mq_status2_t psm2_status;
psm2_mq_req_t req; psm2_mq_req_t req;
int completed = 1; int completed = 0;
do { do {
OPAL_THREAD_LOCK(&mtl_psm2_mq_mutex); OPAL_THREAD_LOCK(&mtl_psm2_mq_mutex);

Просмотреть файл

@ -153,6 +153,7 @@ static int component_register (void)
static int component_progress (void) static int component_progress (void)
{ {
int completed = 0;
int pending_count = opal_list_get_size (&mca_osc_pt2pt_component.pending_operations); int pending_count = opal_list_get_size (&mca_osc_pt2pt_component.pending_operations);
int recv_count = opal_list_get_size (&mca_osc_pt2pt_component.pending_receives); int recv_count = opal_list_get_size (&mca_osc_pt2pt_component.pending_receives);
ompi_osc_pt2pt_pending_t *pending, *next; ompi_osc_pt2pt_pending_t *pending, *next;
@ -167,6 +168,7 @@ static int component_progress (void)
} }
(void) ompi_osc_pt2pt_process_receive (recv); (void) ompi_osc_pt2pt_process_receive (recv);
completed++;
} }
} }
@ -194,12 +196,13 @@ static int component_progress (void)
if (OMPI_SUCCESS == ret) { if (OMPI_SUCCESS == ret) {
opal_list_remove_item (&mca_osc_pt2pt_component.pending_operations, &pending->super); opal_list_remove_item (&mca_osc_pt2pt_component.pending_operations, &pending->super);
OBJ_RELEASE(pending); OBJ_RELEASE(pending);
completed++;
} }
} }
OPAL_THREAD_UNLOCK(&mca_osc_pt2pt_component.pending_operations_lock); OPAL_THREAD_UNLOCK(&mca_osc_pt2pt_component.pending_operations_lock);
} }
return 1; return completed;
} }
static int static int

Просмотреть файл

@ -514,8 +514,7 @@ int mca_pml_ucx_enable(bool enable)
int mca_pml_ucx_progress(void) int mca_pml_ucx_progress(void)
{ {
ucp_worker_progress(ompi_pml_ucx.ucp_worker); return ucp_worker_progress(ompi_pml_ucx.ucp_worker);
return OMPI_SUCCESS;
} }
int mca_pml_ucx_add_comm(struct ompi_communicator_t* comm) int mca_pml_ucx_add_comm(struct ompi_communicator_t* comm)

Просмотреть файл

@ -34,6 +34,7 @@ static opal_mutex_t lock;
static int grequestx_progress(void) { static int grequestx_progress(void) {
ompi_grequest_t *request, *next; ompi_grequest_t *request, *next;
int completed = 0;
OPAL_THREAD_LOCK(&lock); OPAL_THREAD_LOCK(&lock);
if (!in_progress) { if (!in_progress) {
@ -47,6 +48,7 @@ static int grequestx_progress(void) {
OPAL_THREAD_LOCK(&lock); OPAL_THREAD_LOCK(&lock);
opal_list_remove_item(&requests, &request->greq_base.super.super); opal_list_remove_item(&requests, &request->greq_base.super.super);
OPAL_THREAD_UNLOCK(&lock); OPAL_THREAD_UNLOCK(&lock);
completed++;
} }
OPAL_THREAD_LOCK(&lock); OPAL_THREAD_LOCK(&lock);
} }
@ -54,7 +56,7 @@ static int grequestx_progress(void) {
} }
OPAL_THREAD_UNLOCK(&lock); OPAL_THREAD_UNLOCK(&lock);
return OMPI_SUCCESS; return completed;
} }
int ompi_grequestx_start( int ompi_grequestx_start(

Просмотреть файл

@ -563,6 +563,7 @@ static int mca_btl_uct_tl_progress (mca_btl_uct_tl_t *tl, int starting_index)
static int mca_btl_uct_component_progress_pending (mca_btl_uct_module_t *uct_btl) static int mca_btl_uct_component_progress_pending (mca_btl_uct_module_t *uct_btl)
{ {
mca_btl_uct_base_frag_t *frag, *next; mca_btl_uct_base_frag_t *frag, *next;
int completed = 0;
size_t count; size_t count;
if (0 == (count = opal_list_get_size (&uct_btl->pending_frags))) { if (0 == (count = opal_list_get_size (&uct_btl->pending_frags))) {
@ -579,11 +580,13 @@ static int mca_btl_uct_component_progress_pending (mca_btl_uct_module_t *uct_btl
if (OPAL_SUCCESS > mca_btl_uct_send_frag (uct_btl, frag, false)) { if (OPAL_SUCCESS > mca_btl_uct_send_frag (uct_btl, frag, false)) {
opal_list_prepend (&uct_btl->pending_frags, (opal_list_item_t *) frag); opal_list_prepend (&uct_btl->pending_frags, (opal_list_item_t *) frag);
} else {
completed++;
} }
} }
OPAL_THREAD_UNLOCK(&uct_btl->lock); OPAL_THREAD_UNLOCK(&uct_btl->lock);
return OPAL_SUCCESS; return completed;
} }
/** /**