Skip to content

Commit 2860779

Browse files
committed
Shortcut log output if open output stream not open
Move the test for an open output stream to the begin of the log output to skip multi-threaded run related tests. Signed-off-by: Christoph Niethammer <[email protected]>
1 parent 7128fe6 commit 2860779

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tst_output.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ int tst_output_printf(tst_output_stream * output,
144144
int count;
145145
va_list arglist;
146146

147+
if (output->isopen == 0) {
148+
return 0;
149+
}
150+
147151
#ifdef HAVE_MPI2_THREADS
148152
{
149153
if (tst_thread_running()) {
@@ -154,7 +158,7 @@ int tst_output_printf(tst_output_stream * output,
154158
}
155159
#endif
156160

157-
if ((output->isopen == 1) && (output->rank == tst_output_global_rank) && (error_level <= output->level)) {
161+
if ((output->rank == tst_output_global_rank) && (error_level <= output->level)) {
158162
va_start(arglist, format);
159163
count = vfprintf (output->streamptr, format, arglist);
160164
fflush (output->streamptr);

0 commit comments

Comments
 (0)