HavoqGT
havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator > Class Template Reference

Vertex Data storage. More...

#include <delegate_partitioned_graph.hpp>

Public Types

typedef T value_type
 

Public Member Functions

 vertex_data ()
 
T & operator[] (const vertex_locator &locator)
 
const T & operator[] (const vertex_locator &locator) const
 
void reset (const T &r)
 
void all_reduce ()
 
 vertex_data (const delegate_partitioned_graph &dpg, Allocator allocate=Allocator())
 
local_accumulate () const
 
global_accumulate () const
 

Private Attributes

bip::vector< T, Allocator > m_owned_vert_data
 
bip::vector< T, Allocator > m_delegate_data
 

Detailed Description

template<typename SegementManager>
template<typename T, typename Allocator>
class havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >

Vertex Data storage.

Definition at line 114 of file delegate_partitioned_graph.hpp.

Member Typedef Documentation

template<typename SegementManager>
template<typename T, typename Allocator>
typedef T havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::value_type

Definition at line 65 of file vertex_data.hpp.

Constructor & Destructor Documentation

template<typename SegementManager>
template<typename T, typename Allocator>
havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::vertex_data ( )
inline

Definition at line 66 of file vertex_data.hpp.

66 {}
template<typename SegementManager>
template<typename T, typename Allocator>
havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::vertex_data ( const delegate_partitioned_graph dpg,
Allocator  allocate = Allocator() 
)
inline

Definition at line 105 of file vertex_data.hpp.

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());
110  }

Member Function Documentation

template<typename SegementManager>
template<typename T, typename Allocator>
void havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::all_reduce ( )
inline

Definition at line 98 of file vertex_data.hpp.

98  {
99  std::vector<T> tmp_in(m_delegate_data.begin(), m_delegate_data.end());
100  std::vector<T> tmp_out(tmp_in.size(), 0);
101  mpi_all_reduce(tmp_in, tmp_out, std::plus<T>(), MPI_COMM_WORLD);
102  std::copy(tmp_out.begin(), tmp_out.end(), m_delegate_data.begin());
103  }
T mpi_all_reduce(T in_d, Op in_op, MPI_Comm mpi_comm)
Definition: mpi.hpp:176

Here is the call graph for this function:

template<typename SegementManager>
template<typename T, typename Allocator>
T havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::global_accumulate ( ) const
inline

Definition at line 119 of file vertex_data.hpp.

119  {
120  T local = local_accumulate();
121  return mpi_all_reduce(local,std::plus<T>(), MPI_COMM_WORLD);
122  }
T mpi_all_reduce(T in_d, Op in_op, MPI_Comm mpi_comm)
Definition: mpi.hpp:176

Here is the call graph for this function:

template<typename SegementManager>
template<typename T, typename Allocator>
T havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::local_accumulate ( ) const
inline

Definition at line 112 of file vertex_data.hpp.

112  {
113  T to_return = T();
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);
116  return to_return;
117  }
template<typename SegementManager>
template<typename T, typename Allocator>
T& havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::operator[] ( const vertex_locator locator)
inline

Definition at line 68 of file vertex_data.hpp.

69  {
70  if(locator.is_delegate()) {
71  assert(locator.local_id() < m_delegate_data.size());
72  return m_delegate_data[locator.local_id()];
73  }
74  assert(locator.local_id() < m_owned_vert_data.size());
75  return m_owned_vert_data[locator.local_id()];
76  }

Here is the call graph for this function:

template<typename SegementManager>
template<typename T, typename Allocator>
const T& havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::operator[] ( const vertex_locator locator) const
inline

Definition at line 79 of file vertex_data.hpp.

80  {
81  if(locator.is_delegate()) {
82  assert(locator.local_id() < m_delegate_data.size());
83  return m_delegate_data[locator.local_id()];
84  }
85  assert(locator.local_id() < m_owned_vert_data.size());
86  return m_owned_vert_data[locator.local_id()];
87  }

Here is the call graph for this function:

template<typename SegementManager>
template<typename T, typename Allocator>
void havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::reset ( const T &  r)
inline

Definition at line 89 of file vertex_data.hpp.

89  {
90  for(size_t i=0; i<m_owned_vert_data.size(); ++i) {
91  m_owned_vert_data[i] = r;
92  }
93  for(size_t i=0; i<m_delegate_data.size(); ++i) {
94  m_delegate_data[i] = r;
95  }
96  }

Here is the caller graph for this function:

Member Data Documentation

template<typename SegementManager>
template<typename T, typename Allocator>
bip::vector<T, Allocator > havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::m_delegate_data
private

Definition at line 126 of file vertex_data.hpp.

template<typename SegementManager>
template<typename T, typename Allocator>
bip::vector<T, Allocator > havoqgt::mpi::delegate_partitioned_graph< SegementManager >::vertex_data< T, Allocator >::m_owned_vert_data
private

Definition at line 125 of file vertex_data.hpp.


The documentation for this class was generated from the following files: