Skip to content

Commit 2c97187

Browse files
committed
Harmonize return values of progress callbacks
Signed-off-by: Joseph Schuchart <[email protected]>
1 parent 1275766 commit 2c97187

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

ompi/mca/coll/libnbc/coll_libnbc_component.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ ompi_coll_libnbc_progress(void)
427427
{
428428
ompi_coll_libnbc_request_t* request, *next;
429429
int res;
430+
int completed = 0;
430431

431432
if (0 == opal_list_get_size (&mca_coll_libnbc_component.active_requests)) {
432433
/* no requests -- nothing to do. do not grab a lock */
@@ -464,14 +465,15 @@ ompi_coll_libnbc_progress(void)
464465
if(!request->super.super.req_persistent || !REQUEST_COMPLETE(&request->super.super)) {
465466
ompi_request_complete(&request->super.super, true);
466467
}
468+
completed++;
467469
}
468470
OPAL_THREAD_LOCK(&mca_coll_libnbc_component.lock);
469471
}
470472
libnbc_in_progress = false;
471473
}
472474
OPAL_THREAD_UNLOCK(&mca_coll_libnbc_component.lock);
473475

474-
return 0;
476+
return completed;
475477
}
476478

477479

ompi/mca/mtl/psm2/mtl_psm2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ int ompi_mtl_psm2_progress( void ) {
403403
mca_mtl_psm2_request_t* mtl_psm2_request;
404404
psm2_mq_status2_t psm2_status;
405405
psm2_mq_req_t req;
406-
int completed = 1;
406+
int completed = 0;
407407

408408
do {
409409
OPAL_THREAD_LOCK(&mtl_psm2_mq_mutex);

ompi/mca/osc/pt2pt/osc_pt2pt_component.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ static int component_register (void)
153153

154154
static int component_progress (void)
155155
{
156+
int completed = 0;
156157
int pending_count = opal_list_get_size (&mca_osc_pt2pt_component.pending_operations);
157158
int recv_count = opal_list_get_size (&mca_osc_pt2pt_component.pending_receives);
158159
ompi_osc_pt2pt_pending_t *pending, *next;
@@ -167,6 +168,7 @@ static int component_progress (void)
167168
}
168169

169170
(void) ompi_osc_pt2pt_process_receive (recv);
171+
completed++;
170172
}
171173
}
172174

@@ -194,12 +196,13 @@ static int component_progress (void)
194196
if (OMPI_SUCCESS == ret) {
195197
opal_list_remove_item (&mca_osc_pt2pt_component.pending_operations, &pending->super);
196198
OBJ_RELEASE(pending);
199+
completed++;
197200
}
198201
}
199202
OPAL_THREAD_UNLOCK(&mca_osc_pt2pt_component.pending_operations_lock);
200203
}
201204

202-
return 1;
205+
return completed;
203206
}
204207

205208
static int

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,7 @@ int mca_pml_ucx_enable(bool enable)
514514

515515
int mca_pml_ucx_progress(void)
516516
{
517-
ucp_worker_progress(ompi_pml_ucx.ucp_worker);
518-
return OMPI_SUCCESS;
517+
return ucp_worker_progress(ompi_pml_ucx.ucp_worker);
519518
}
520519

521520
int mca_pml_ucx_add_comm(struct ompi_communicator_t* comm)

ompi/request/grequestx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static opal_mutex_t lock;
3434

3535
static int grequestx_progress(void) {
3636
ompi_grequest_t *request, *next;
37+
int completed = 0;
3738

3839
OPAL_THREAD_LOCK(&lock);
3940
if (!in_progress) {
@@ -47,14 +48,15 @@ static int grequestx_progress(void) {
4748
OPAL_THREAD_LOCK(&lock);
4849
opal_list_remove_item(&requests, &request->greq_base.super.super);
4950
OPAL_THREAD_UNLOCK(&lock);
51+
completed++;
5052
}
5153
OPAL_THREAD_LOCK(&lock);
5254
}
5355
in_progress = false;
5456
}
5557
OPAL_THREAD_UNLOCK(&lock);
5658

57-
return OMPI_SUCCESS;
59+
return completed;
5860
}
5961

6062
int ompi_grequestx_start(

opal/mca/btl/uct/btl_uct_component.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ static int mca_btl_uct_tl_progress (mca_btl_uct_tl_t *tl, int starting_index)
563563
static int mca_btl_uct_component_progress_pending (mca_btl_uct_module_t *uct_btl)
564564
{
565565
mca_btl_uct_base_frag_t *frag, *next;
566+
int completed = 0;
566567
size_t count;
567568

568569
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
579580

580581
if (OPAL_SUCCESS > mca_btl_uct_send_frag (uct_btl, frag, false)) {
581582
opal_list_prepend (&uct_btl->pending_frags, (opal_list_item_t *) frag);
583+
} else {
584+
completed++;
582585
}
583586
}
584587
OPAL_THREAD_UNLOCK(&uct_btl->lock);
585588

586-
return OPAL_SUCCESS;
589+
return completed;
587590
}
588591

589592
/**

0 commit comments

Comments
 (0)