4#include <thrust/host_vector.h>
5#include <thrust/gather.h>
8#include "blas1_dispatch_shared.h"
35template<
class container>
42 : m_comm ( MPI_COMM_NULL)
52 : m_data(
data), m_comm(comm)
64 template<
class OtherContainer>
72 const container&
data()
const {
return m_data;}
76 container&
data() {
return m_data;}
94 unsigned size()
const{
return m_data.size();}
100 m_data.swap(src.m_data);
101 std::swap( m_comm , src.m_comm);
121template<
class container>
Error classes or the dg library.
typename TensorTraits< std::decay_t< Vector > >::execution_policy get_execution_policy
Definition tensor_traits.h:49
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition tensor_traits.h:45
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
A simple wrapper around a container object and an MPI_Comm.
Definition mpi_vector.h:37
friend void swap(MPI_Vector< container > &first, MPI_Vector< container > &second)
Definition mpi_vector.h:104
MPI_Vector()
no data is allocated, communicator is MPI_COMM_NULL
Definition mpi_vector.h:41
const container & data() const
Get underlying data.
Definition mpi_vector.h:72
MPI_Vector(const MPI_Vector< OtherContainer > &src)
Conversion operator.
Definition mpi_vector.h:65
container & data()
Set underlying data.
Definition mpi_vector.h:76
MPI_Comm communicator() const
Get the communicator to which this vector belongs.
Definition mpi_vector.h:80
MPI_Vector(container data, MPI_Comm comm)
construct a vector
Definition mpi_vector.h:51
container container_type
typedef to acces underlying container
Definition mpi_vector.h:38
void set_communicator(MPI_Comm comm)
Set the communicator.
Definition mpi_vector.h:87
unsigned size() const
Return the size of the data object.
Definition mpi_vector.h:94
void swap(MPI_Vector &src)
Swap data and communicator.
Definition mpi_vector.h:98
A distributed vector contains a data container and a MPI communicator.
Definition vector_categories.h:52
get_value_type< container > value_type
Definition mpi_vector.h:123
get_execution_policy< container > execution_policy
Definition mpi_vector.h:125
The vector traits.
Definition tensor_traits.h:38