opal_progress: use usec native timer only when a native cycle counter isn't available
Signed-off-by: Carlos Bederián <bc@famaf.unc.edu.ar>
Этот коммит содержится в:
родитель
f4ad119693
Коммит
4009ba6b94
@ -37,6 +37,7 @@
|
|||||||
#include "opal/runtime/opal_params.h"
|
#include "opal/runtime/opal_params.h"
|
||||||
|
|
||||||
#define OPAL_PROGRESS_USE_TIMERS (OPAL_TIMER_CYCLE_SUPPORTED || OPAL_TIMER_USEC_SUPPORTED)
|
#define OPAL_PROGRESS_USE_TIMERS (OPAL_TIMER_CYCLE_SUPPORTED || OPAL_TIMER_USEC_SUPPORTED)
|
||||||
|
#define OPAL_PROGRESS_ONLY_USEC_NATIVE (OPAL_TIMER_USEC_NATIVE && !OPAL_TIMER_CYCLE_NATIVE)
|
||||||
|
|
||||||
#if OPAL_ENABLE_DEBUG
|
#if OPAL_ENABLE_DEBUG
|
||||||
bool opal_progress_debug = false;
|
bool opal_progress_debug = false;
|
||||||
@ -189,11 +190,11 @@ opal_progress(void)
|
|||||||
if( opal_progress_event_flag != 0 ) {
|
if( opal_progress_event_flag != 0 ) {
|
||||||
#if OPAL_HAVE_WORKING_EVENTOPS
|
#if OPAL_HAVE_WORKING_EVENTOPS
|
||||||
#if OPAL_PROGRESS_USE_TIMERS
|
#if OPAL_PROGRESS_USE_TIMERS
|
||||||
#if OPAL_TIMER_USEC_NATIVE
|
#if OPAL_PROGRESS_ONLY_USEC_NATIVE
|
||||||
opal_timer_t now = opal_timer_base_get_usec();
|
opal_timer_t now = opal_timer_base_get_usec();
|
||||||
#else
|
#else
|
||||||
opal_timer_t now = opal_timer_base_get_cycles();
|
opal_timer_t now = opal_timer_base_get_cycles();
|
||||||
#endif /* OPAL_TIMER_USEC_NATIVE */
|
#endif /* OPAL_PROGRESS_ONLY_USEC_NATIVE */
|
||||||
/* trip the event library if we've reached our tick rate and we are
|
/* trip the event library if we've reached our tick rate and we are
|
||||||
enabled */
|
enabled */
|
||||||
if (now - event_progress_last_time > event_progress_delta ) {
|
if (now - event_progress_last_time > event_progress_delta ) {
|
||||||
@ -316,7 +317,7 @@ opal_progress_set_event_poll_rate(int polltime)
|
|||||||
|
|
||||||
#if OPAL_PROGRESS_USE_TIMERS
|
#if OPAL_PROGRESS_USE_TIMERS
|
||||||
event_progress_delta = 0;
|
event_progress_delta = 0;
|
||||||
# if OPAL_TIMER_USEC_NATIVE
|
# if OPAL_PROGRESS_ONLY_USEC_NATIVE
|
||||||
event_progress_last_time = opal_timer_base_get_usec();
|
event_progress_last_time = opal_timer_base_get_usec();
|
||||||
# else
|
# else
|
||||||
event_progress_last_time = opal_timer_base_get_cycles();
|
event_progress_last_time = opal_timer_base_get_cycles();
|
||||||
@ -343,7 +344,7 @@ opal_progress_set_event_poll_rate(int polltime)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OPAL_PROGRESS_USE_TIMERS && !OPAL_TIMER_USEC_NATIVE
|
#if OPAL_PROGRESS_USE_TIMERS && !OPAL_PROGRESS_ONLY_USEC_NATIVE
|
||||||
/* going to use cycles for counter. Adjust specified usec into cycles */
|
/* going to use cycles for counter. Adjust specified usec into cycles */
|
||||||
event_progress_delta = event_progress_delta * opal_timer_base_get_freq() / 1000000;
|
event_progress_delta = event_progress_delta * opal_timer_base_get_freq() / 1000000;
|
||||||
#endif
|
#endif
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user