I am running in a cluster. I tried to run my executable with 4 different forms:
In serial, with
myexec
This starts giving output in
stdout
right away, as expected.In serial, redirecting
stdout
andstderr
, withmyexec > out-err.log 2>&1
This starts giving output in
out-err.log
right away, as expected (verified withcat out-err.log
in another terminal).In parallel, with
mpirun -n 2 myexec
This starts giving output in
stdout
right away, as expected.In parallel, redirecting
stdout
andstderr
, withmpirun -n 2 myexec > out-err.log 2>&1
This retains output until job is finished (due to completion or time allowance).
Is there any way of having stdout/stderr "flushed" at runtime in case 4, so I can check out-err.log
?