#include <delegate_partitioned_graph.hpp>
Classes | |
class | edge_data |
Edge Data storage. More... | |
class | edge_iterator |
class | vert_info |
class | vertex_data |
Vertex Data storage. More... | |
class | vertex_iterator |
class | vertex_locator |
Public Types | |
enum | ConstructionState { New, MetaDataGenerated, EdgeStorageAllocated, LowEdgesPartitioned, HighEdgesPartitioned, GraphReady } |
template<typename T > | |
using | SegmentAllocator = bip::allocator< T, SegementManager > |
typedef bip::vector< vertex_locator, SegmentAllocator< vertex_locator > >::const_iterator | controller_iterator |
Public Member Functions | |
template<typename Container > | |
delegate_partitioned_graph (const SegmentAllocator< void > &seg_allocator, MPI_Comm mpi_comm, Container &edges, uint64_t max_vertex, uint64_t delegate_degree_threshold, ConstructionState stop_after=GraphReady) | |
Constructor that initializes given and unsorted sequence of edges. More... | |
template<typename Container > | |
void | complete_construction (const SegmentAllocator< void > &seg_allocator, MPI_Comm mpi_comm, Container &edges) |
Edge storage allocation phase of graph construction. More... | |
void | print_graph_statistics () |
uint64_t | locator_to_label (vertex_locator locator) const |
Converts a vertex_locator to the vertex label. More... | |
vertex_locator | label_to_locator (uint64_t label) const |
Converts a vertex label to a vertex_locator. More... | |
edge_iterator | edges_begin (vertex_locator locator) const |
Returns a begin iterator for edges of a vertex. More... | |
edge_iterator | edges_end (vertex_locator locator) const |
Returns an end iterator for edges of a vertex. More... | |
uint64_t | degree (vertex_locator locator) const |
Returns the degree of a vertex. More... | |
uint64_t | local_degree (vertex_locator locator) const |
Returns the local degree of a vertex. More... | |
vertex_iterator | vertices_begin () const |
Returns a begin iterator for all local vertices. More... | |
vertex_iterator | vertices_end () const |
Returns an end iterator for all local vertices. More... | |
bool | is_label_delegate (uint64_t label) const |
Tests if vertex label is a delegate. More... | |
template<typename T , typename SegManagerOther > | |
vertex_data< T, SegManagerOther > * | create_vertex_data (SegManagerOther *, const char *obj_name=nullptr) const |
Creates vertex_data of type T. More... | |
template<typename T , typename SegManagerOther > | |
vertex_data< T, SegManagerOther > * | create_vertex_data (const T &init, SegManagerOther *, const char *obj_name=nullptr) const |
Creates vertex_data of type T, with initial value. More... | |
template<typename T , typename SegManagerOther > | |
edge_data< T, SegManagerOther > * | create_edge_data (SegManagerOther *, const char *obj_name=nullptr) const |
Creates edge_data of type T. More... | |
template<typename T , typename SegManagerOther > | |
edge_data< T, SegManagerOther > * | create_edge_data (const T &init, SegManagerOther *, const char *obj_name=nullptr) const |
Creates edge_data of type T, with initial value. More... | |
size_t | num_local_vertices () const |
uint64_t | max_global_vertex_id () |
uint64_t | max_local_vertex_id () |
size_t | num_delegates () const |
uint32_t | master (const vertex_locator &locator) const |
controller_iterator | controller_begin () const |
controller_iterator | controller_end () const |
bool | compare (delegate_partitioned_graph< SegementManager > *b) |
bool | operator== (delegate_partitioned_graph< SegementManager > &other) |
bool | operator!= (delegate_partitioned_graph< SegementManager > &other) |
template<typename T , typename SegManagerOther > | |
delegate_partitioned_graph< SegmentManager >::template edge_data< T, SegManagerOther > * | create_edge_data (SegManagerOther *segment_manager_o, const char *obj_name) const |
Private Member Functions | |
void | sync_global_hub_set (const boost::unordered_set< uint64_t > &local_hubs, boost::unordered_set< uint64_t > &global_hubs, bool local_change) |
Synchronizes hub set amongst all processes. More... | |
void | initialize_low_meta_data (boost::unordered_set< uint64_t > &global_hub_set) |
void | initialize_high_meta_data (boost::unordered_set< uint64_t > &global_hubs) |
void | initialize_edge_storage (const SegmentAllocator< void > &seg_allocator) |
template<typename Container > | |
void | partition_low_degree (Container &unsorted_edges) |
template<typename InputIterator > | |
void | count_high_degree_edges (InputIterator unsorted_itr, InputIterator unsorted_itr_end, boost::unordered_set< uint64_t > &global_hub_set) |
template<typename Container > | |
void | partition_high_degree (Container &unsorted_edges, std::map< uint64_t, std::deque< OverflowSendInfo > > &transfer_info) |
template<typename InputIterator > | |
void | count_edge_degrees (InputIterator unsorted_itr, InputIterator unsorted_itr_end, boost::unordered_set< uint64_t > &global_hub_set, uint64_t delegate_degree_threshold) |
void | send_high_info (std::vector< boost::container::map< uint64_t, uint64_t > > &maps_to_send, int maps_to_send_element_count) |
void | send_vertex_info (uint64_t &high_vertex_count, uint64_t delegate_degree_threshold, std::vector< boost::container::map< int, std::pair< uint64_t, uint64_t > > > &maps_to_send, int maps_to_send_element_count) |
void | calculate_overflow (std::map< uint64_t, std::deque< OverflowSendInfo > > &transfer_info) |
void | generate_send_list (std::vector< uint64_t > &send_list, uint64_t num_send, int send_id, std::map< uint64_t, std::deque< OverflowSendInfo > > &transfer_info) |
void | flush_graph () |
Delegate partitioned graph using MPI for communication.
Test using simple deterministic patterns.
Add edge_data
Make vertex_iterator a random access iterator
Add invalid bit or state to vertex_locator
Verify low-degree CSR creation: ipp line 167
Boostify controller locator
Put details here for class
Definition at line 98 of file delegate_partitioned_graph.hpp.
typedef bip::vector<vertex_locator, SegmentAllocator<vertex_locator> >::const_iterator havoqgt::mpi::delegate_partitioned_graph< SegementManager >::controller_iterator |
Definition at line 213 of file delegate_partitioned_graph.hpp.
using havoqgt::mpi::delegate_partitioned_graph< SegementManager >::SegmentAllocator = bip::allocator<T, SegementManager> |
Definition at line 101 of file delegate_partitioned_graph.hpp.
enum havoqgt::mpi::delegate_partitioned_graph::ConstructionState |
Enumerator | |
---|---|
New | |
MetaDataGenerated | |
EdgeStorageAllocated | |
LowEdgesPartitioned | |
HighEdgesPartitioned | |
GraphReady |
Definition at line 121 of file delegate_partitioned_graph.hpp.
havoqgt::mpi::delegate_partitioned_graph< SegmentManager >::delegate_partitioned_graph | ( | const SegmentAllocator< void > & | seg_allocator, |
MPI_Comm | mpi_comm, | ||
Container & | edges, | ||
uint64_t | max_vertex, | ||
uint64_t | delegate_degree_threshold, | ||
ConstructionState | stop_after = GraphReady |
||
) |
Constructor that initializes given and unsorted sequence of edges.
Builds a delegate_partitioned_graph with from and unsorted sequence of edges.
sm | Pointer to segment manager MPI communicator |
Container | input edges to partition |
delegate_degree_threshold | Threshold used to assign delegates |
<
<
Meta data phase of graph construction
Definition at line 71 of file delegate_partitioned_graph.ipp.
|
private |
This function initlizes the transfer_info object by determining which nodes needs extra edges and which nodes have extra edges. This information is exchanged so that nodes that need more edges will know how many extra edges it will recieve.
: the mpi communication group
&owned_high_count | tracks the number of high edges owned by this node it is updated when we give to or recieve edges from another node. |
transfer_info | used to track to whome and how many edges are given to another node |
Definition at line 1013 of file delegate_partitioned_graph.ipp.
|
inline |
Definition at line 223 of file delegate_partitioned_graph.hpp.
void havoqgt::mpi::delegate_partitioned_graph< SegmentManager >::complete_construction | ( | const SegmentAllocator< void > & | seg_allocator, |
MPI_Comm | mpi_comm, | ||
Container & | edges | ||
) |
Edge storage allocation phase of graph construction.
Edge partitioning phase of graph construction
Controller construction phase of graph construction
End of graph construction
Definition at line 162 of file delegate_partitioned_graph.ipp.
|
inline |
Definition at line 215 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 219 of file delegate_partitioned_graph.hpp.
|
private |
This function iterates (1) through the edges and calculates the following:
m_local_incoming_count: For each vertedx that is assigned to this node it determines the number of incoming edges
high_vertex_count: the number of high edges generated b
: MPI communication
unsorted_itr | The edge generator iteratior |
unsorted_itr_end | The end of the edge generator iterator |
global_hubs | A map of all hub vertex. This map is filled in this function |
delegate_degree_threshold | The mininum number of edges a high degree vertex has incomming. |
Definition at line 280 of file delegate_partitioned_graph.ipp.
|
private |
This function iterates (through the edges and tracks the number of outgoing edges for each delegate vertex and exchanges that information with the other nodes.
Definition at line 836 of file delegate_partitioned_graph.ipp.
edge_data<T, SegManagerOther>* havoqgt::mpi::delegate_partitioned_graph< SegementManager >::create_edge_data | ( | SegManagerOther * | , |
const char * | obj_name = nullptr |
||
) | const |
Creates edge_data of type T.
delegate_partitioned_graph< SegmentManager >::edge_data< T, SegManagerOther > * havoqgt::mpi::delegate_partitioned_graph< SegmentManager >::create_edge_data | ( | const T & | init, |
SegManagerOther * | segment_manager_o, | ||
const char * | obj_name = nullptr |
||
) | const |
Creates edge_data of type T, with initial value.
init | initial value for each vertex |
Definition at line 1687 of file delegate_partitioned_graph.ipp.
delegate_partitioned_graph<SegmentManager>::template edge_data<T, SegManagerOther>* havoqgt::mpi::delegate_partitioned_graph< SegementManager >::create_edge_data | ( | SegManagerOther * | segment_manager_o, |
const char * | obj_name | ||
) | const |
Definition at line 1663 of file delegate_partitioned_graph.ipp.
vertex_data<T, SegManagerOther>* havoqgt::mpi::delegate_partitioned_graph< SegementManager >::create_vertex_data | ( | SegManagerOther * | , |
const char * | obj_name = nullptr |
||
) | const |
Creates vertex_data of type T.
vertex_data<T, SegManagerOther>* havoqgt::mpi::delegate_partitioned_graph< SegementManager >::create_vertex_data | ( | const T & | init, |
SegManagerOther * | , | ||
const char * | obj_name = nullptr |
||
) | const |
Creates vertex_data of type T, with initial value.
|
inline |
Returns the degree of a vertex.
locator | Vertex locator |
Definition at line 1599 of file delegate_partitioned_graph.ipp.
|
inline |
Returns a begin iterator for edges of a vertex.
locator | Vertex locator |
Definition at line 1560 of file delegate_partitioned_graph.ipp.
|
inline |
Returns an end iterator for edges of a vertex.
locator | Vertex locator |
Definition at line 1580 of file delegate_partitioned_graph.ipp.
|
private |
|
private |
This function, in a non optimized manner, generates a list of vertexs and counts to send to a node that needs more delegate edges.
Edges are sent in the parition_high_degree function, this only tells the node how many edges to expect for each delegate vertex.
It can be improved by optimizing how selection is done.
send_list | the location to store the [dest, count] pairs |
num_send | the number of edges to needed to send |
send_id | the location to send the edges. (used by transfer_info) : A map of delegate vertex to a dequeue of [dest,count] pairs used to track which nodes will be recieving extra high edges. |
Definition at line 1195 of file delegate_partitioned_graph.ipp.
|
private |
Definition at line 620 of file delegate_partitioned_graph.ipp.
|
private |
This function allocates and initlizes several of data members. It is called after the count_edge_degrees function, which determined the size of these data memebers.
global_hubs | the set of hub vertices |
delegate_degree_threshold | The edge limit when a vertex becomes a hub. |
Definition at line 540 of file delegate_partitioned_graph.ipp.
|
private |
This function allocates and initlizes several of data members. It is called after the count_edge_degrees function, which determined the size of these data memebers.
global_hubs | the set of hub vertices |
delegate_degree_threshold | The edge limit when a vertex becomes a hub. |
Definition at line 493 of file delegate_partitioned_graph.ipp.
|
inline |
Tests if vertex label is a delegate.
Definition at line 1652 of file delegate_partitioned_graph.ipp.
|
inline |
Converts a vertex label to a vertex_locator.
label | vertex label to convert |
Definition at line 1511 of file delegate_partitioned_graph.ipp.
|
inline |
Returns the local degree of a vertex.
locator | Vertex locator |
Definition at line 1619 of file delegate_partitioned_graph.ipp.
|
inline |
Converts a vertex_locator to the vertex label.
locator | vertex_locator to convert |
Definition at line 1491 of file delegate_partitioned_graph.ipp.
|
inline |
Definition at line 208 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 195 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 199 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 204 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 191 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 258 of file delegate_partitioned_graph.hpp.
|
inline |
Definition at line 227 of file delegate_partitioned_graph.hpp.
|
private |
This function iterates (3) over the edges and if an edge has a delegate vertex as a source sends it to the apprioriate node based on the edge's destination. If this node is giving edges to another node, then when this node has enough edges for a delegate, extra edges are sent to a node that needs edges for that delegate.
: The mpi communication group
unsorted_itr | An iterator over edges |
unsorted_itr_end | The end of the iterator over edges |
global_hub_set | A set of all global hubs |
transfer_info | A map of delegate_id to a deque of OverflowSendInfo used to determine where overflowed edges go. |
Definition at line 1257 of file delegate_partitioned_graph.ipp.
|
private |
This function iterates (2) through the edges and sends the low degree edges to the nodes that own them.
At the same time it tracks the number of outgoing edges for each delegate vertex and exchanges that information with the other nodes.
Definition at line 683 of file delegate_partitioned_graph.ipp.
void havoqgt::mpi::delegate_partitioned_graph< SegmentManager >::print_graph_statistics | ( | ) |
Definition at line 1707 of file delegate_partitioned_graph.ipp.
|
private |
This function has each node exchange with one another their delegate vertex incoming edge count.
: the mpi communication group
maps_to_send | a vector of maps that map delegate_id to edge count. |
Definition at line 963 of file delegate_partitioned_graph.ipp.
|
private |
This function is used to send/recv information about vertexes during the count_edge_degrees function.
: them_mpi_communication group
high_vertex_count | tracks the number of high vertices, used to determine how much space to allocate for the delegate degree info later on. |
delegate_degree_threshold | The mininum number of edges a high degree vertex has incomming. |
maps_to_send | a vector of maps of vertex ids to pairs of incoming and outgoing edge counts. |
Definition at line 426 of file delegate_partitioned_graph.ipp.
|
inlineprivate |
Synchronizes hub set amongst all processes.
Gather operations performed when at least one process has found new local hubs
local_hubs | set of local hubs |
global_hubs | set of global hubs to be updated |
found_new_hub_locally | true, if new local hub has been found |
Definition at line 1536 of file delegate_partitioned_graph.ipp.
|
inline |
Returns a begin iterator for all local vertices.
Definition at line 1636 of file delegate_partitioned_graph.ipp.
|
inline |
Returns an end iterator for all local vertices.
Definition at line 1644 of file delegate_partitioned_graph.ipp.
|
protected |
Definition at line 323 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 368 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 352 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 349 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 351 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 353 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 356 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 357 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 336 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 337 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 335 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 334 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 330 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 340 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 339 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 365 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 333 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 328 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 327 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 326 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 342 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 343 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 345 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 346 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 325 of file delegate_partitioned_graph.hpp.
|
protected |
Definition at line 324 of file delegate_partitioned_graph.hpp.