Skip to content

Commit 3829cac

Browse files
devrealawlauria
authored andcommitted
Have opal_progress() return the number of events it encountered
This information can used by callers to decide how to proceed based on whether operations have progressed. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu> (cherry picked from commit 8961692)
1 parent b6dbae2 commit 3829cac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

opal/runtime/opal_progress.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int opal_progress_events(void)
213213
* care, as the cost of that happening is far outweighed by the cost
214214
* of the if checks (they were resulting in bad pipe stalling behavior)
215215
*/
216-
void opal_progress(void)
216+
int opal_progress(void)
217217
{
218218
static uint32_t num_calls = 0;
219219
size_t i;
@@ -250,6 +250,8 @@ void opal_progress(void)
250250
*/
251251
opal_thread_yield();
252252
}
253+
254+
return events;
253255
}
254256

255257
int opal_progress_set_event_flag(int flag)

opal/runtime/opal_progress.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ OPAL_DECLSPEC int opal_progress_init(void);
5757
* opal_progress_event_users_delete()) or the time since the last call
5858
* into the event library is greater than the progress tick rate (by
5959
* default, 10ms).
60+
*
61+
* Returns 0 if no progress has been observed, non-zero otherwise.
6062
*/
61-
OPAL_DECLSPEC void opal_progress(void);
63+
OPAL_DECLSPEC int opal_progress(void);
6264

6365
/**
6466
* Control how the event library is called

0 commit comments

Comments
 (0)