dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #17478
Re: MPI distribute
On Tue, Feb 09, 2010 at 08:35:47PM +0100, Anders Logg wrote:
> On Tue, Feb 09, 2010 at 02:31:24PM +0000, Garth N. Wells wrote:
> > Can someone provide a brief synopsis of the function
> >
> > MPI::distribute(std::vector<uint>& values, std::vector<uint>& partition);
> >
> > ?
> >
> > Garth
>
> Yes, this is a function Ola and I found very useful. It's based on
> some code that Niclas wrote which was repeated in a few places. We
> simplified it and made it work with STL containers.
>
> What it does is the following. Each process prepares two arrays:
>
> values
> partition
>
> where partition[i] is the number of the partition (process) which
> should receive value[i]. Note that values and partition need to be
> arrays of equal length.
>
> After the call to distribute(), the contents of the values array will
> contain the values each process has received, and partition[i] will
> tell you which process that value came from.
So in other words, this wraps a global send-receive among all
processes. Everyone can potentially send something to everyone and
everyone can potentially receive something from everyone, but the
communication is handled in a clever way so that the processes take
turns communicating in pairs with each other.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References