1#ifndef _RHEOLEF_SCATTER_MESSAGE_H
2#define _RHEOLEF_SCATTER_MESSAGE_H
27#include "rheolef/compiler.h"
28#ifdef _RHEOLEF_HAVE_MPI
32template<
class Container,
bool T_is_MPI_simple = false>
38template<
class Container>
56 const Container&
values ()
const {
return _values; }
57 Container&
values () {
return _values; }
58 const std::vector<size_type>&
indices()
const {
return _indices; }
59 std::vector<size_type>&
indices() {
return _indices; }
60 const std::vector<size_type>&
procs ()
const {
return _procs; }
61 std::vector<size_type>&
procs () {
return _procs; }
62 const std::vector<size_type>&
starts ()
const {
return _starts; }
63 std::vector<size_type>&
starts () {
return _starts; }
65 std::list<std::pair<size_type,mpi::request> >
requests;
79 : _init_value (init_value),
87 local_slots_nonmatching(),
88 local_nonmatching_computed(false),
89 local_n_nonmatching(0),
95 _values.resize (n_data, _init_value);
96 _indices.resize (n_data);
97 _procs.resize (nproc);
98 _starts.resize (nproc+1);
100 template <
class InputIterator>
101 void load_values (InputIterator x);
103 template<
class OutputIterator,
class SetOp>
104 void store_values (OutputIterator y,
size_type i_receive, SetOp op)
const;
117template<
class Container>
137 const std::vector<base_value_type>&
values ()
const {
return _multi_values; }
138 std::vector<base_value_type>&
values () {
return _multi_values; }
140 const std::vector<size_type>&
indices()
const {
return _multi_indices; }
141 std::vector<size_type>&
indices() {
return _multi_indices; }
142 const std::vector<size_type>&
procs ()
const {
return _multi_procs; }
143 std::vector<size_type>&
procs () {
return _multi_procs; }
144 const std::vector<size_type>&
starts ()
const {
return _multi_starts; }
145 std::vector<size_type>&
starts () {
return _multi_starts; }
158 _multi_irecv2base_irecv()
163 template <
class InputIterator>
164 void load_values (InputIterator x);
166 template<
class OutputIterator,
class SetOp>
167 void store_values (OutputIterator y,
size_type i_receive, SetOp op)
const;
180#include "rheolef/scatter_message.icc"
field::size_type size_type
const std::vector< size_type > & indices() const
size_type n_local() const
Container::size_type size_type
std::vector< size_type > _procs
const std::vector< size_type > & starts() const
scatter_message(const value_type &init_value=value_type(), const allocator_type &alloc=allocator_type())
const Container & values() const
Container::value_type value_type
std::vector< size_type > & starts()
bool local_nonmatching_computed
const std::vector< size_type > & procs() const
Container::allocator_type allocator_type
size_type local_n_nonmatching
std::vector< size_type > local_slots
std::vector< mpi::status > sstatus
size_type n_local_nonmatching() const
size_type local_copy_length
void resize(size_type n_data, size_type nproc)
std::list< std::pair< size_type, mpi::request > > requests
std::vector< size_type > & indices()
size_type n_status() const
size_type local_copy_start
std::vector< size_type > & procs()
std::vector< size_type > _indices
std::vector< size_type > _starts
std::vector< size_type > local_slots_nonmatching
value_type base_value_type
const std::vector< size_type > & indices() const
std::vector< size_type > _multi_starts
scatter_message< std::vector< typename Container::size_type >, false > base
const std::vector< size_type > & starts() const
std::vector< base_value_type > & values()
Container::value_type value_type
std::vector< size_type > & starts()
const std::vector< size_type > & procs() const
std::vector< base_value_type > _multi_values
const std::vector< base_value_type > & values() const
base::size_type size_type
std::vector< size_type > & indices()
std::vector< size_type > _multi_procs
std::vector< size_type > _ptr
std::vector< size_type > _multi_indices
value_type::value_type base_value_type
std::vector< size_type > _multi_irecv2base_irecv
std::vector< size_type > & procs()
This file is part of Rheolef.