Boost logo

Boost Users :

Subject: Re: [Boost-users] mpi all reduce with std::vector and back_inserter
From: Júlio Hoffimann (julio.hoffimann_at_[hidden])
Date: 2011-05-05 18:24:50


Hi Kraus,

If i understood well, it's not the case for `all_reduce`, you need
`all_gather` instead:

http://www.boost.org/doc/libs/1_46_1/doc/html/boost/mpi/all_gather.html

<http://www.boost.org/doc/libs/1_46_1/doc/html/boost/mpi/all_gather.html>The
vectors has the same size?

Regards,
Júlio.

2011/5/5 Kraus Philipp <philipp.kraus_at_[hidden]>

> Hello,
>
> I have a std::vector<std::string> vector at each CPU. I would like to
> "reduce" all vectors on all CPUs. For example:
>
> CPU 0: vec = [a, b, c, d]
> CPU 1: vec = [e, f, g, h]
>
> std::vector<std::string> myreduce;
> mpi::all_reduce( mpi com object, vec, myreduce, #);
>
> myreduce = [a, b, c, d, e, f, g, h]
>
> How can I do this? Should I replace my # with a back_inserter of the
> std::vector?
>
> Thx for help
>
> Phil
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net