1
1

Add an MCA param to help debug the ORTE progress thread

This commit was SVN r27614.
This commit is contained in:
Ralph Castain 2012-11-15 15:54:38 +00:00
parent 5241925b62
commit da6428a822
4 changed files with 36 additions and 14 deletions

View File

@ -67,6 +67,9 @@ ORTE_DECLSPEC extern bool orte_report_silent_errors; /* instantiated in orte/ru
ORTE_DECLSPEC extern opal_event_base_t *orte_event_base; /* instantiated in orte/runtime/orte_init.c */
ORTE_DECLSPEC extern bool orte_event_base_active; /* instantiated in orte/runtime/orte_init.c */
ORTE_DECLSPEC extern bool orte_proc_is_bound; /* instantiated in orte/runtime/orte_init.c */
ORTE_DECLSPEC extern int orte_progress_thread_debug; /* instantiated in orte/runtime/orte_init.c */
#if OPAL_HAVE_HWLOC
/**
* Global indicating where this process was bound to at launch (will

View File

@ -59,6 +59,7 @@ bool orte_create_session_dirs = true;
opal_event_base_t *orte_event_base;
bool orte_event_base_active = true;
bool orte_proc_is_bound = false;
int orte_progress_thread_debug = -1;
#if OPAL_HAVE_HWLOC
hwloc_cpuset_t orte_proc_applied_binding = NULL;
#endif

View File

@ -182,6 +182,14 @@ int orte_register_params(void)
orte_debug_daemons_flag = true;
}
mca_base_param_reg_int_name("orte", "progress_thread_debug",
"Debug level for ORTE progress threads",
false, false, -1, &value);
if (0 <= value) {
orte_progress_thread_debug = opal_output_open(NULL);
opal_output_set_verbosity(orte_progress_thread_debug, value);
}
/* do we want session output left open? */
mca_base_param_reg_int_name("orte", "leave_session_attached",
"Whether applications and/or daemons should leave their sessions "

View File

@ -119,22 +119,32 @@ OBJ_CLASS_DECLARATION(orte_timer_t);
* confusion
*/
#if ORTE_ENABLE_PROGRESS_THREADS
#define ORTE_WAIT_FOR_COMPLETION(flg) \
do { \
while ((flg)) { \
/* provide a very short quiet period so we \
* don't hammer the cpu while we wait \
*/ \
struct timespec tp = {0, 100}; \
nanosleep(&tp, NULL); \
} \
#define ORTE_WAIT_FOR_COMPLETION(flg) \
do { \
opal_output_verbose(1, orte_progress_thread_debug, \
"%s waiting on progress thread at %s:%d", \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__); \
while ((flg)) { \
/* provide a very short quiet period so we \
* don't hammer the cpu while \
*/ \
struct timespec tp = {0, 100}; \
nanosleep(&tp, NULL); \
} \
}while(0);
#else
#define ORTE_WAIT_FOR_COMPLETION(flg) \
do { \
while ((flg)) { \
opal_progress(); \
} \
#define ORTE_WAIT_FOR_COMPLETION(flg) \
do { \
opal_output_verbose(1, orte_progress_thread_debug, \
"%s looping opal_progress at %s:%d", \
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
__FILE__, __LINE__); \
while ((flg)) { \
opal_progress(); \
} \
}while(0);
#endif