64 typedef std::vector< id_pair<T> >
vector;
73 void pack(
void *buf,
int bufsize,
int *position, MPI_Comm comm)
const {
74 element.pack(buf, bufsize, position, comm);
78 static id_pair unpack(
void *buf,
int bufsize,
int *position, MPI_Comm comm) {
79 T t = T::unpack(buf, bufsize, position, comm);
103 std::ostream& operator<<(std::ostream& out, const id_pair<T>& p) {
104 out <<
"<" << p.
element <<
", " << p.id <<
">";
std::vector< id_pair< T > > vector
Template typedef for declaring vectors of id_pair<T>
static id_pair unpack(void *buf, int bufsize, int *position, MPI_Comm comm)
int packed_size(MPI_Comm comm) const
id_pair< T > make_id_pair(const T &elt, int id)
Helper function for making arbitrary id_pairs with type inference.
T element
The object wrapped by this id_pair.
id_pair(const T &elt, size_t _id)
MPI-packable struct for an MPI-packable type plus its object id.
#defines for switching between MPI and PMPI bindings.
void pack(void *buf, int bufsize, int *position, MPI_Comm comm) const
size_t id
Id of the rank where element came from.