1
1
* fix an if condition so that we do the right thing when procs local to mpirun output to stderr

* ensure that tools can handle relays of 0-byte output, indicating that a process closed that io channel

This commit was SVN r19884.
Этот коммит содержится в:
Ralph Castain 2008-11-03 14:03:08 +00:00
родитель c4f0eb276a
Коммит 85bc7bb26a
2 изменённых файлов: 18 добавлений и 11 удалений

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

@ -193,13 +193,15 @@ void orte_iof_hnp_read_local_handler(int fd, short event, void *cbdata)
(ORTE_IOF_STDOUT & rev->tag) ? "stdout" : ((ORTE_IOF_STDERR & rev->tag) ? "stderr" : "stddiag"),
ORTE_NAME_PRINT(&rev->name)));
if ( (0 != numbytes) && (ORTE_IOF_STDOUT & rev->tag) ) {
orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stdout);
} else {
orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stderr);
if (0 != numbytes) {
if (ORTE_IOF_STDOUT & rev->tag) {
orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stdout);
} else {
orte_iof_base_write_output(&rev->name, rev->tag, data, numbytes, &orte_iof_base.iof_write_stderr);
}
}
CLEAN_RETURN:
/* if we read 0 bytes from the stdout/err/diag, there is
* nothing to output - close these file descriptors,

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

@ -90,11 +90,16 @@ static void process_msg(int fd, short event, void *cbdata)
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), numbytes,
ORTE_NAME_PRINT(&origin)));
/* write the output locally */
if (ORTE_IOF_STDOUT & stream) {
orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stdout);
} else {
orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stderr);
/* if numbytes is zero, it means that the channel was closed on the far end - for
* now, we just ignore this condition
*/
if (0 < numbytes) {
/* write the output locally */
if (ORTE_IOF_STDOUT & stream) {
orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stdout);
} else {
orte_iof_base_write_output(&origin, stream, data, numbytes, &orte_iof_base.iof_write_stderr);
}
}
CLEAN_RETURN: