Skip to content

Commit

Permalink
MPI resize/copy: different inner state types for both sides. #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Germroth committed Aug 6, 2013
1 parent 875a13d commit 92c0a40
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions boost/numeric/odeint/external/mpi/mpi_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ struct is_resizeable< mpi_state< InnerState > >
: is_resizeable< InnerState > { };


template< class InnerState >
struct same_size_impl< mpi_state< InnerState > , mpi_state< InnerState > >
template< class InnerState1 , class InnerState2 >
struct same_size_impl< mpi_state< InnerState1 > , mpi_state< InnerState2 > >
{
static bool same_size( const mpi_state< InnerState > &x , const mpi_state< InnerState > &y )
static bool same_size( const mpi_state< InnerState1 > &x , const mpi_state< InnerState2 > &y )
{
const bool local = boost::numeric::odeint::same_size(x.data, y.data);
return boost::mpi::all_reduce(x.world, local, mpi::bitwise_and<bool>());
}
};


template< class InnerState >
struct resize_impl< mpi_state< InnerState > , mpi_state< InnerState > >
template< class InnerState1 , class InnerState2 >
struct resize_impl< mpi_state< InnerState1 > , mpi_state< InnerState2 > >
{
static void resize( mpi_state< InnerState > &x , const mpi_state< InnerState > &y )
static void resize( mpi_state< InnerState1 > &x , const mpi_state< InnerState2 > &y )
{
// resize local parts on each node.
boost::numeric::odeint::resize(x.data, y.data);
Expand All @@ -78,10 +78,10 @@ struct resize_impl< mpi_state< InnerState > , mpi_state< InnerState > >


/** \brief Copy data between mpi_states of same size. */
template< class InnerState >
struct copy_impl< mpi_state< InnerState >, mpi_state< InnerState > >
template< class InnerState1 , class InnerState2 >
struct copy_impl< mpi_state< InnerState1 > , mpi_state< InnerState2 > >
{
static void copy( const mpi_state< InnerState > &from, mpi_state< InnerState > &to )
static void copy( const mpi_state< InnerState1 > &from , mpi_state< InnerState2 > &to )
{
// copy local parts on each node.
boost::numeric::odeint::copy(from.data, to.data);
Expand Down

0 comments on commit 92c0a40

Please sign in to comment.