Boost logo

Boost Users :

Subject: Re: [Boost-users] mpi all reduce with std::vector and back_inserter
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-05-05 18:42:21


Am 06.05.2011 um 00:24 schrieb Júlio Hoffimann:

> 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
>
> The vectors has the same size?

No, they have different sizes. I use all_gather, but I must iterate
over each element in the result vector and put the elements into a new
vector. I do this at the time:

std::vector< std::vector<std::string> > result;
mpi::all_gather( mpi object, vec, result);

std::vector<std::string> myvec;
foreach( result as res )
      myvec.push_back( foreach in res );

I need the loop after all_gather and my question is: Can I do the loop
call into the mpi command, so that I don't have a loop after the gather?

Thx

Phil



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