1
1

Remove opal_recursion_depth_counter and opal_progress_thread_count. These counters add two

atomics in the critical path and are not currently used. We can bring them back if there
turns out to be a good use for them.

cmr=v1.7.4:reviewer=brbarret

This commit was SVN r29994.
Этот коммит содержится в:
Nathan Hjelm 2013-12-19 23:15:27 +00:00
родитель 0c6b292442
Коммит ee9cd13b90
2 изменённых файлов: 2 добавлений и 38 удалений

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

@ -43,7 +43,6 @@ bool opal_progress_debug = false;
* default parameters
*/
static int opal_progress_event_flag = OPAL_EVLOOP_ONCE | OPAL_EVLOOP_NONBLOCK;
volatile int32_t opal_progress_thread_count = 0;
int opal_progress_spin_count = 10000;
@ -73,9 +72,6 @@ static int32_t event_progress_delta = 0;
be every time */
static int32_t num_event_users = 0;
/* How deep are we in opal_progress recursion? */
uint32_t opal_progress_recursion_depth_counter = 0;
#if OPAL_ENABLE_DEBUG
static int debug_output = -1;
#endif
@ -155,8 +151,6 @@ opal_progress(void)
size_t i;
int events = 0;
opal_atomic_add(&opal_progress_recursion_depth_counter, 1);
if( opal_progress_event_flag != 0 ) {
#if OPAL_HAVE_WORKING_EVENTOPS
#if OPAL_PROGRESS_USE_TIMERS
@ -202,8 +196,6 @@ opal_progress(void)
sched_yield();
}
#endif /* defined(HAVE_SCHED_YIELD) */
opal_atomic_add(&opal_progress_recursion_depth_counter, -1);
}

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

@ -173,54 +173,26 @@ OPAL_DECLSPEC int opal_progress_register(opal_progress_callback_t cb);
OPAL_DECLSPEC int opal_progress_unregister(opal_progress_callback_t cb);
OPAL_DECLSPEC extern volatile int32_t opal_progress_thread_count;
OPAL_DECLSPEC extern int opal_progress_spin_count;
static inline bool opal_progress_threads(void)
{
return (opal_progress_thread_count > 0);
}
/**
* Progress until flag is true or poll iterations completed
*/
static inline bool opal_progress_spin(volatile bool* complete)
{
int32_t c;
OPAL_THREAD_ADD32(&opal_progress_thread_count,1);
for (c = 0; c < opal_progress_spin_count; c++) {
if (true == *complete) {
OPAL_THREAD_ADD32(&opal_progress_thread_count,-1);
return true;
}
opal_progress();
}
OPAL_THREAD_ADD32(&opal_progress_thread_count,-1);
return false;
}
/**
* \internal
* Don't use this variable; use the opal_progress_recursion_depth()
* function.
*/
OPAL_DECLSPEC extern uint32_t opal_progress_recursion_depth_counter;
/**
* Return the current level of recursion -- 0 means that we are not
* under an opal_progress() call at all. 1 means that you're in the
* top-level opal_progress() function (i.e., not deep in recursion).
* Higher values mean that you're that many levels deep in recursion.
*/
static inline uint32_t opal_progress_recursion_depth(void)
{
opal_atomic_mb();
return opal_progress_recursion_depth_counter;
}
END_C_DECLS
#endif