Stdout forwarding should continue to work in v4.0.x just like it did in v3.0.x. 
 I.e., printf's from your app should appear in the stdout of mpirun.

Sometimes they can get buffered, however, such as if you redirect the stdout to 
a file or to a pipe.  Such shell buffering may only emit output when it sees 
\n's, or a buffer-full at a time (e.g., 4K?).

For example (typed directly in my mail client -- YMMV):

$ cat foo.c
#include <mpi.h>
int main(int args, char* argv[]) {
    MPI_Init(NULL, NULL);
    printf("Hello, world\n");
    Return 0;
$ mpicc foo.c -o foo
$ mpirun -np 1 foo
Hello, world
<...waits 60 seconds...>
$ mpirun -np 1 foo | tee out.txt
<...waits 60 seconds>
Hello, world

The latter run may not emit anything for 60 seconds because the single line of 
"Hello, world" may not have been an entire buffer-full, so the pipe chose not 
to emit it until a) it fills its buffer, or b) the program completes.

Buffering like that depends very much on how the buffering is implemented 
(e.g., by the shell).  So it may be outside of Open MPI's control.

> On May 8, 2019, at 9:02 PM, Nilton Luiz Queiroz Junior via users 
> <> wrote:
> I had upgraded my MPI from 3.0.0 to 4.0.1 version, so when I compile (with 
> mpicc) and run (with mpirun) any .c source file that uses printf function 
> from stdio, i dont get the print results in stdout. Does anyone knows what it 
> can be?
> I'm very thankful for your attention.
> Nilton.
> _______________________________________________
> users mailing list

Jeff Squyres

users mailing list

Reply via email to