Hi,
There doesn't seems to be an elgant way to do an in place all_reduce
on array right now (Although I only stumbled on the issue after
I moved to openmpi 1.3.2).
That is, if all_reduce_impl is called with (in_values == out_values)
MPI is allowed to compain with a MPI_ERR_BUF. Of course, one
can call all_reduce with static_cast(MPI_IN_PLACE) but I do not
find that solution very elegant.
Would it be a problem to modify all_reduce_impl into:
template
void
all_reduce_impl(const communicator& comm, const T* in_values, int n,
T* out_values, Op /*op*/, mpl::true_ /*is_mpi_op*/,
mpl::true_ /*is_mpi_datatype*/)
{
if (in_values == out_values) {
in_values = static_cast(MPI_IN_PLACE);
}
BOOST_MPI_CHECK_RESULT(MPI_Allreduce,
(const_cast(in_values), out_values, n,
boost::mpi::get_mpi_datatype<T>(*in_values),
(is_mpi_op::op()), comm));
}
It worked for me, and if there is an agreement I can propose a patch.
Regards,
--
Alain Miniussi
http://www.oca.eu/alainm
Equipe CRIMSON https://crimson.oca.eu
+33 492 00 30 09