Re: [Boost-bugs] [Boost C++ Libraries] #6704: Boost version of mpi_in_place

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6704: Boost version of mpi_in_place
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-31 11:39:10


#6704: Boost version of mpi_in_place
-----------------------------------------------------+----------------------
  Reporter: Alain Miniussi <alain.miniussi@…> | Owner: dgregor
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: mpi
   Version: Boost 1.48.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------------------------+----------------------

Comment (by anonymous):

 Replying to [comment:9 anonymous]:
> One more question:
>
> Right now, in the attached patch, we have
> {{{
> template<typename T, typename Op>
> void all_reduce(const communicator & comm, const T & in_value,
> T & out_value, Op op);
> template<typename T, typename Op>
> T all_reduce(const communicator & comm, const T & in_value, Op op);
> template<typename T, typename Op>
> void all_reduce(const communicator & comm, const T * in_values, int n,
> T * out_values, Op op);
> }}}
> plus
> {{{
> template<typename T, typename Op>
> void all_reduce(const communicator & comm, T * inout_values, int n,
> Op op);
> }}}
> but we do not have:
> {{{
> template<typename T, typename Op>
> void all_reduce(const communicator & comm, T & in_value, Op op);
> }}}
> that's based on the assumption that there isn't much usage for it and
 that it would cause confusing overload issues.


 After discussing this I find that actually an in-place version that does
 not return a copy makes more sense for in-place semantics, and the call
 might be as
 {{{
 template<typename T, typename Op>
 void all_reduce(const communicator & comm, mpi::inplace_t<T> in_value, Op
 op);
 }}}
 where mpi::inplace_t<T> wrapper might be created by an mpi::inplace
 function. Thus by using mpi::inplace around the one argument we don't
 return anything. I would not use a two-parameter version where one
 parameter is replaced by an mpi::inplace placeholder like the C API does.
 We should go for a nicer C++ API and not try to just copy the C API as the
 deprecated official MPI C++ API did.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6704#comment:13>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC