Boost logo

Boost-MPI :

Subject: [Boost-mpi] scatterv
From: MM (finjulhich_at_[hidden])
Date: 2016-07-01 13:37:01


Hello,

It seems the documentation here
http://www.boost.org/doc/libs/1_61_0/doc/html/boost/mpi/scatterv.html
is inaccurate if I understood this function correctly.

in_values: vector or pointer to storage that will contain the values to
send to each process, indexed by the process rank.
This vector is not indexed by process rank. It contains all the values that
would be scattered to each process (including the root process)

Ignoring displacements and focusing on this function

template<typename T>
  void scatterv(const communicator & comm, const std::vector< T > &
in_values,
                const std::vector< int > & sizes, T * out_values, int root);

3 processes, root rank 0, and rank 1 and rank 2

Does "sizes" contain { s1, s2 } only or { s0, s1, s2 }?

in_values = { 1, 2, 3, 4, 5, 6, 7 };
If we assume s1=2 and s2=3, therefore s0=2=7-2-3

In the root process:
std::vector<int> out_values( s0=2 );
scatterv(world, in_values, {s1,s2}, out_values.data(), rank=0);

and in rank 1:
std::vector<int> out_values( s1=2 );
scatterv(world, out_values.data(), outsize=2, rank=0);

and rank 2:
std::vector<int> out_values( s2=3);
scatterv(world, out_values.data(), outsize=3 rank=0);

Is this how it's supposed to work?

Regards,



Boost-Commit list run by troyer at boostpro.com