standard output in Fortran MPI code

前端 未结 3 1526
Happy的楠姐
Happy的楠姐 2021-01-19 03:28

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:

if(r         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-19 03:36

    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.

提交回复
热议问题