← Back to team overview

dolfin team mailing list archive

Re: MPI distribute

 

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.

--
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References