[Dune] Question about parallelization

Markus Blatt Markus.Blatt at iwr.uni-heidelberg.de
Thu Sep 9 13:30:03 CEST 2010


Hi,

On Thu, Sep 09, 2010 at 10:14:20AM +0200, Aleksejs Fomins wrote:
> I use the collective communication class and its operations gather
> and min to communicate data.
> 
> 1) If I use the gather, min operations, do I have to run them in all
> processes?
> Even if I require the resulting data only in the master process?

Yes, because every process in the underlying communicator is expected
to send something. (That is why the beast is called collecive)

> 
> 2) If I need to communicate 1 double from all processes to the
> master process,
> do I just make a double array of size 1 in all processes and use a
> gather operation on it?

That is for the input. For the output you must allocate an array of n
(the number of processes) on the root process. This passed as the
second argument to the gather function. All other processes might pass
a null pointer.

> 
> 3) Do I understand correctly, that
> in the gather operation, arrays sent by each process have to be the
> same in size,
> and furthermore, every entry of the array which is templated to T
> has to be the same size as well?
> 

Yes.

Markus
-- 
Markus Blatt, Interdisciplinary Center for Scientific Computing,
University Heidelberg, Im Neuenheimer Feld 368, D-69120 Heidelberg

'Mathematics knows no races or geographic boundaries; for
mathematics, the cultural world is one country' - David Hilbert




More information about the Dune mailing list