Skip to content

Commit 4009ba6

Browse files
committed
opal_progress: use usec native timer only when a native cycle counter isn't available
Signed-off-by: Carlos Bederián <[email protected]>
1 parent f4ad119 commit 4009ba6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

opal/runtime/opal_progress.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include "opal/runtime/opal_params.h"
3838

3939
#define OPAL_PROGRESS_USE_TIMERS (OPAL_TIMER_CYCLE_SUPPORTED || OPAL_TIMER_USEC_SUPPORTED)
40+
#define OPAL_PROGRESS_ONLY_USEC_NATIVE (OPAL_TIMER_USEC_NATIVE && !OPAL_TIMER_CYCLE_NATIVE)
4041

4142
#if OPAL_ENABLE_DEBUG
4243
bool opal_progress_debug = false;
@@ -189,11 +190,11 @@ opal_progress(void)
189190
if( opal_progress_event_flag != 0 ) {
190191
#if OPAL_HAVE_WORKING_EVENTOPS
191192
#if OPAL_PROGRESS_USE_TIMERS
192-
#if OPAL_TIMER_USEC_NATIVE
193+
#if OPAL_PROGRESS_ONLY_USEC_NATIVE
193194
opal_timer_t now = opal_timer_base_get_usec();
194195
#else
195196
opal_timer_t now = opal_timer_base_get_cycles();
196-
#endif /* OPAL_TIMER_USEC_NATIVE */
197+
#endif /* OPAL_PROGRESS_ONLY_USEC_NATIVE */
197198
/* trip the event library if we've reached our tick rate and we are
198199
enabled */
199200
if (now - event_progress_last_time > event_progress_delta ) {
@@ -316,7 +317,7 @@ opal_progress_set_event_poll_rate(int polltime)
316317

317318
#if OPAL_PROGRESS_USE_TIMERS
318319
event_progress_delta = 0;
319-
# if OPAL_TIMER_USEC_NATIVE
320+
# if OPAL_PROGRESS_ONLY_USEC_NATIVE
320321
event_progress_last_time = opal_timer_base_get_usec();
321322
# else
322323
event_progress_last_time = opal_timer_base_get_cycles();
@@ -343,7 +344,7 @@ opal_progress_set_event_poll_rate(int polltime)
343344
#endif
344345
}
345346

346-
#if OPAL_PROGRESS_USE_TIMERS && !OPAL_TIMER_USEC_NATIVE
347+
#if OPAL_PROGRESS_USE_TIMERS && !OPAL_PROGRESS_ONLY_USEC_NATIVE
347348
/* going to use cycles for counter. Adjust specified usec into cycles */
348349
event_progress_delta = event_progress_delta * opal_timer_base_get_freq() / 1000000;
349350
#endif

0 commit comments

Comments
 (0)