[Dune] Sequential Streams for Console Output of Parallell Programs

Markus Blatt markus at dr-blatt.de
Fri Apr 12 09:43:40 CEST 2013


Hi Jayesh,

On Fri, Apr 12, 2013 at 10:23:37AM +0530, Jayesh Badwaik wrote:
> I am trying to write a parallel program in DUNE and would like to get a
> single sequential std::cout for the same which prints only from node 0. For
> this purpose, for every std::cout statement, I wrote a custom function for
> the same.
> 
> However, then I thought there might be a facility for the printing the
> sequential output in DUNE. Hence, I wish to ask if there is a provision for
> creation of a stream which prints only on the master node (node 0).
> 

No there is no such thing. The reason for this is, that IMHO this
functionality is rather limited and will not scale properly:

Whenever a process wants to print something either the root process
has to know this and issue a receiving call or one must use asynchronous
communication and the root process regularly has to query for message
to output.

I any way this involves unnecessary small messages and additional
synchronization points in the algorithms. Both should be avoided as
they result in less scalable codes.

Of course my view on this issue might be limited. If you have another
superior approach, feel free to discuss it on our developer list.

Cheers,

Markus


-- 
Do you need more support with DUNE or HPC in general? 

Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858  Fax: +49 (0)322 1108991658 




More information about the Dune mailing list