1
1

Use same prefix format for [host:pid]

Hostname and PID are output as a message prefix in many places in
our code. Their printf-formats were either `[%s:%d]` or `[%s:%05d]`.
This commit changes `[%s:%d]` to `[%s:%05d]`. The latter was more
widely used in our code (including OPAL output system and the signal
handler).

Signed-off-by: KAWASHIMA Takahiro <t-kawashima@jp.fujitsu.com>
Этот коммит содержится в:
KAWASHIMA Takahiro 2017-06-07 17:28:26 +09:00
родитель 6b91eddc8b
Коммит 362445d486
4 изменённых файлов: 6 добавлений и 6 удалений

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

@ -193,7 +193,7 @@ static void backend_fatal_aggregate(char *type,
arg = va_arg(arglist, char*);
va_end(arglist);
if (asprintf(&prefix, "[%s:%d]",
if (asprintf(&prefix, "[%s:%05d]",
ompi_process_info.nodename,
(int) ompi_process_info.pid) == -1) {
prefix = NULL;

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

@ -148,7 +148,7 @@ ompi_mpi_abort(struct ompi_communicator_t* comm,
if (OPAL_SUCCESS == opal_backtrace_buffer(&messages, &len)) {
for (i = 0; i < len; ++i) {
fprintf(stderr, "[%s:%d] [%d] func:%s\n", host, (int) pid,
fprintf(stderr, "[%s:%05d] [%d] func:%s\n", host, (int) pid,
i, messages[i]);
fflush(stderr);
}
@ -167,7 +167,7 @@ ompi_mpi_abort(struct ompi_communicator_t* comm,
/* If the RTE isn't setup yet/any more, then don't even try
killing everyone. Sorry, Charlie... */
if (!ompi_rte_initialized) {
fprintf(stderr, "[%s:%d] Local abort %s completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!\n",
fprintf(stderr, "[%s:%05d] Local abort %s completed successfully, but am not able to aggregate error messages, and not able to guarantee that all other processes were killed!\n",
host, (int) pid, ompi_mpi_finalized ?
"after MPI_FINALIZE started" : "before MPI_INIT completed");
_exit(errcode == 0 ? 1 : errcode);

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

@ -65,7 +65,7 @@ void mca_rcache_base_mem_cb (void* base, size_t size, void* cbdata, bool from_al
if (rc != OPAL_SUCCESS) {
if (from_alloc) {
int len;
len = snprintf(msg, sizeof(msg), "[%s:%d] Attempt to free memory that is still in "
len = snprintf(msg, sizeof(msg), "[%s:%05d] Attempt to free memory that is still in "
"use by an ongoing MPI communication (buffer %p, size %lu). MPI job "
"will now abort.\n", opal_proc_local_get()->proc_hostname,
getpid(), base, (unsigned long) size);

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

@ -81,7 +81,7 @@ int oshmem_shmem_abort(int errcode)
if (OPAL_SUCCESS == opal_backtrace_buffer(&messages, &len)) {
for (i = 0; i < len; ++i) {
fprintf(stderr,
"[%s:%d] [%d] func:%s\n",
"[%s:%05d] [%d] func:%s\n",
host,
(int) pid,
i,
@ -110,7 +110,7 @@ int oshmem_shmem_abort(int errcode)
(int) pid);
} else {
fprintf(stderr,
"[%s:%d] Local abort completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!\n",
"[%s:%05d] Local abort completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!\n",
host,
(int) pid);
}