I have a parallel fortran code in which I want only the rank=0 process to be able to write to stdout, but I don\'t want to have to litter the code with:
mpirun comes with the option to redirect stdout from each process into separate files. For example, -output-filename out would result in out.1.0, out.1.1, ... which you then can monitor using whatever way you like (I use tail -f). Next to if(rank.eq.0) this is the cleanest solution I think.