|
Boost : |
From: Matthias Troyer (troyer_at_[hidden])
Date: 2007-11-30 02:24:38
On 29 Nov 2007, at 16:46, David Osipyan wrote:
> I try to use boost.mpi in my particle-in-cell simulation code.
> I have a vector of particles. How can I send parts of this vector
> from root process to all of slaves, and send backward to root ?
> Is it possible via mpi::scatter() and mpi::skeleton/content?
>
> I need to send particles from range 0..n to first slave, n+1 ..
> 2*n+1 to second slave etc. After porocessing each slave shall
> return the new values of parts to root.
Yes, you can use scatter and gather to do that. If your data type is
an "MPI data type", and you have specialized is_mpi_datatype<T> to be
mpl::true_ to indicate this, then no skeleton/content is required but
you can just call gather/scatter on a std::vector.
Matthias
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk