Reputation: 15561
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
and stderr
, with
myexec > out-err.log 2>&1
This starts giving output in out-err.log
right away, as expected (verified with cat 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
and stderr
, with
mpirun -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
?
Upvotes: 6
Views: 2120
Reputation: 15561
This is a known feature/issue with redirection in mpi. I found how to solve this:
Add export OMPI_MCA_opal_event_include=poll
in ~/.bashrc
, or
Add opal_event_include=poll
in ~/.openmpi/mca-params.conf
(create the dir and/or file if they do not exist).
The sources used to get info are:
https://github.com/open-mpi/ompi/issues/341
https://www.open-mpi.org/doc/v2.0/man1/mpirun.1.php#sect20
Upvotes: 4