From 900f3bde32fd290d12be3b8ba853654322fefab5 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Mon, 13 Dec 2004 22:39:09 +0000 Subject: [PATCH] - Remove some old debugging printf's - Formalize the Windoze output - The facilities for lazy opening of files were already included in here (yay foresight!); so just don't open the file aggressively when we ompi_output_open(); instead, let the first ompi_output() open the file. This allows the session directory to stay empty (and therefore removable) if the file is never written to. This commit was SVN r3800. --- src/util/output.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/util/output.c b/src/util/output.c index 4943cd650f..b5c98aaf49 100644 --- a/src/util/output.c +++ b/src/util/output.c @@ -386,7 +386,7 @@ static int do_open(int output_id, ompi_output_stream_t *lds) } #else if (NULL == (info[i].ldi_syslog_ident = - RegisterEventSource(NULL, TEXT("To be determined: OMPI")))) { + RegisterEventSource(NULL, TEXT("Open MPI: ")))) { /* handle the error */ return OMPI_ERROR; } @@ -412,11 +412,9 @@ static int do_open(int output_id, ompi_output_stream_t *lds) strdup(lds->lds_file_suffix); info[i].ldi_file_want_append = lds->lds_want_file_append; info[i].ldi_file_num_lines_lost = 0; - if (lds->lds_want_file) { - if (OMPI_SUCCESS != (ret = open_file(i))) { - return ret; - } - } + + /* Don't open a file in the session directory now -- do that lazily + so that if there's no output, we don't have an empty file */ return i; } @@ -451,7 +449,6 @@ static int open_file(int i) /* Actually open the file */ info[i].ldi_fd = open(filename, flags, 0644); - printf("output: opening file: %s\n", filename); if (-1 == info[i].ldi_fd) { info[i].ldi_used = false; return OMPI_ERR_IN_ERRNO; @@ -610,7 +607,6 @@ static void output(int output_id, char *format, va_list arglist) } } if (ldi->ldi_fd != -1) { - printf("proc session dir: %s\n", ompi_process_info.proc_session_dir); write(ldi->ldi_fd, temp_str, total_len); } }