53 #ifndef HAVOQGT_MPI_IMPL_VERTEX_DATA_HPP_
54 #define HAVOQGT_MPI_IMPL_VERTEX_DATA_HPP_
61 template <
typename SegementManager>
62 template <
typename T,
typename Allocator >
63 class delegate_partitioned_graph<SegementManager>::vertex_data {
71 assert(locator.
local_id() < m_delegate_data.size());
72 return m_delegate_data[locator.
local_id()];
74 assert(locator.
local_id() < m_owned_vert_data.size());
75 return m_owned_vert_data[locator.
local_id()];
82 assert(locator.
local_id() < m_delegate_data.size());
83 return m_delegate_data[locator.
local_id()];
85 assert(locator.
local_id() < m_owned_vert_data.size());
86 return m_owned_vert_data[locator.
local_id()];
90 for(
size_t i=0; i<m_owned_vert_data.size(); ++i) {
91 m_owned_vert_data[i] = r;
93 for(
size_t i=0; i<m_delegate_data.size(); ++i) {
94 m_delegate_data[i] = r;
99 std::vector<T> tmp_in(m_delegate_data.begin(), m_delegate_data.end());
100 std::vector<T> tmp_out(tmp_in.size(), 0);
102 std::copy(tmp_out.begin(), tmp_out.end(), m_delegate_data.begin());
106 : m_owned_vert_data(allocate)
107 , m_delegate_data(allocate) {
108 m_owned_vert_data.resize(dpg.m_owned_info.size());
109 m_delegate_data.resize(dpg.m_delegate_info.size());
114 to_return = std::accumulate(m_owned_vert_data.begin(), m_owned_vert_data.end(), to_return);
115 to_return = std::accumulate(m_delegate_data.begin(), m_delegate_data.end(), to_return);
120 T local = local_accumulate();
131 #endif // HAVOQGT_MPI_IMPL_VERTEX_DATA_HPP_
T local_accumulate() const
bip::vector< T, Allocator > m_owned_vert_data
bip::vector< T, Allocator > m_delegate_data
T mpi_all_reduce(T in_d, Op in_op, MPI_Comm mpi_comm)
T global_accumulate() const
vertex_data(const delegate_partitioned_graph &dpg, Allocator allocate=Allocator())
uint64_t local_id() const