1
1

Support the option of outputting error_log messages with something other than the process name

This commit was SVN r24784.
Этот коммит содержится в:
Ralph Castain 2011-06-17 14:50:00 +00:00
родитель 61dd7f4588
Коммит 042ee3ec48
3 изменённых файлов: 39 добавлений и 4 удалений

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

@ -59,6 +59,7 @@
#include "orte/util/name_fns.h"
#include "orte/util/session_dir.h"
#include "orte/util/proc_info.h"
#include "orte/runtime/orte_globals.h"
#include "orte/runtime/runtime.h"
@ -190,9 +191,17 @@ void orte_errmgr_base_log(int error_code, char *filename, int line)
return;
}
opal_output(0, "%s ORTE_ERROR_LOG: %s in file %s at line %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
errstring, filename, line);
if (NULL != orte_process_info.job_name) {
opal_output(0, "[[%s][%s][%s][%d]] ORTE_ERROR_LOG: %s in file %s at line %d",
orte_process_info.job_name,
(NULL == orte_process_info.job_instance) ? "NULL" : orte_process_info.job_instance,
(NULL == orte_process_info.executable) ? "NULL" : orte_process_info.executable,
orte_process_info.app_rank, errstring, filename, line);
} else {
opal_output(0, "%s ORTE_ERROR_LOG: %s in file %s at line %d",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
errstring, filename, line);
}
}
void orte_errmgr_base_abort(int error_code, char *fmt, ...)

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

@ -59,7 +59,11 @@ ORTE_DECLSPEC orte_proc_info_t orte_process_info = {
/* .proc_session_dir = */ NULL,
/* .sock_stdin = */ NULL,
/* .sock_stdout = */ NULL,
/* .sock_stderr = */ NULL
/* .sock_stderr = */ NULL,
/* .job_name = */ NULL,
/* .job_instance = */ NULL,
/* .executable = */ NULL,
/* .app_rank = */ -1
};
static bool init=false;
@ -140,6 +144,23 @@ int orte_proc_info(void)
true, false, 0, &tmp);
orte_process_info.num_restarts = tmp;
mca_base_param_reg_string_name("orte", "job_name",
"Job name",
true, false, NULL, &orte_process_info.job_name);
mca_base_param_reg_string_name("orte", "job_instance",
"Job instance",
true, false, NULL, &orte_process_info.job_instance);
mca_base_param_reg_string_name("orte", "executable",
"Executable",
true, false, NULL, &orte_process_info.executable);
mca_base_param_reg_int_name("orte", "app_rank",
"Rank of this proc within its app_context",
true, false, 0, &tmp);
orte_process_info.app_rank = tmp;
/* setup the sync buffer */
orte_process_info.sync_buf = OBJ_NEW(opal_buffer_t);

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

@ -108,6 +108,11 @@ struct orte_proc_info_t {
char *sock_stdin; /**< Path name to temp file for stdin. */
char *sock_stdout; /**< Path name to temp file for stdout. */
char *sock_stderr; /**< Path name to temp file for stderr. */
/* name/instance info for debug support */
char *job_name;
char *job_instance;
char *executable;
int32_t app_rank;
};
typedef struct orte_proc_info_t orte_proc_info_t;