Galois
|
Base DistGraph class that all distributed graphs extend from. More...
#include <DistributedGraph.h>
Classes | |
struct | IdLess |
used to sort edges in the sort edges function More... | |
Public Types | |
using | GraphNode = typename GraphTy::GraphNode |
Type representing a node in this graph. More... | |
using | EdgeType = EdgeTy |
Expose EdgeTy to other classes. More... | |
using | iterator = typename GraphTy::iterator |
iterator type over nodes More... | |
using | const_iterator = typename GraphTy::const_iterator |
constant iterator type over nodes More... | |
using | edge_iterator = typename GraphTy::edge_iterator |
iterator type over edges More... | |
Public Member Functions | |
DistGraph (unsigned host, unsigned numHosts) | |
Constructor for DistGraph. More... | |
std::vector< std::pair < uint32_t, uint32_t > > | getMirrorRanges () const |
Return a vector of pairs denoting mirror node ranges. More... | |
std::vector< std::vector < size_t > > & | getMirrorNodes () |
virtual unsigned | getHostID (uint64_t) const =0 |
Determines which host has the master for a particular node. More... | |
virtual bool | isOwned (uint64_t) const =0 |
Determine if a node has a master on this host. More... | |
virtual bool | isLocal (uint64_t) const =0 |
Determine if a node has a proxy on this host. More... | |
virtual bool | is_vertex_cut () const =0 |
Returns true if current partition is a vertex cut. More... | |
virtual std::pair< unsigned, unsigned > | cartesianGrid () const |
Returns Cartesian split (if it exists, else returns pair of 0s. More... | |
bool | isTransposed () |
uint64_t | getGID (const uint32_t nodeID) const |
Converts a local node id into a global node id. More... | |
uint32_t | getLID (const uint64_t nodeID) const |
Converts a global node id into a local node id. More... | |
NodeTy & | getData (GraphNode N, galois::MethodFlag mflag=galois::MethodFlag::UNPROTECTED) |
Get data of a node. More... | |
GraphTy::edge_data_reference | getEdgeData (edge_iterator ni, galois::MethodFlag mflag=galois::MethodFlag::UNPROTECTED) |
Get the edge data for a particular edge in the graph. More... | |
GraphNode | getEdgeDst (edge_iterator ni) |
Gets edge destination of edge ni. More... | |
edge_iterator | edge_begin (GraphNode N) |
Gets the first edge of some node. More... | |
edge_iterator | edge_end (GraphNode N) |
Gets the end edge boundary of some node. More... | |
galois::runtime::iterable < galois::NoDerefIterator < edge_iterator > > | edges (GraphNode N) |
Returns an iterable object over the edges of a particular node in the graph. More... | |
size_t | size () const |
Gets number of nodes on this (local) graph. More... | |
size_t | sizeEdges () const |
Gets number of edges on this (local) graph. More... | |
size_t | numMasters () const |
Gets number of nodes on this (local) graph. More... | |
size_t | getNumNodesWithEdges () const |
Gets number of nodes with edges (may include nodes without edges) on this (local) graph. More... | |
size_t | globalSize () const |
Gets number of nodes on the global unpartitioned graph. More... | |
size_t | globalSizeEdges () const |
Gets number of edges on the global unpartitioned graph. More... | |
const NodeRangeType & | allNodesRange () const |
Returns a range object that encapsulates all nodes of the graph. More... | |
const NodeRangeType & | masterNodesRange () const |
Returns a range object that encapsulates only master nodes in this graph. More... | |
const NodeRangeType & | allNodesWithEdgesRange () const |
Returns a range object that encapsulates master nodes and nodes with edges in this graph. More... | |
void | save_local_graph_to_file (std::string) |
Write the local LC_CSR graph to the file on a disk. More... | |
void | read_local_graph_from_file (std::string) |
Read the local LC_CSR graph from the file on a disk. More... | |
void | deallocate () |
Deallocates underlying LC CSR Graph. More... | |
void | sortEdgesByDestination () |
Sort the underlying LC_CSR_Graph by ID (destinations) It sorts edges of the nodes by destination. More... | |
Protected Member Functions | |
void | increment_evilPhase () |
Increments evilPhase, a phase counter used by communication. More... | |
unsigned | evilPhasePlus1 () |
Returns evilPhase + 1, handling loop around as necessary. More... | |
uint64_t | computeMasters (MASTERS_DISTRIBUTION masters_distribution, galois::graphs::OfflineGraph &g, const std::vector< unsigned > &scalefactor, uint32_t nodeWeight=0, uint32_t edgeWeight=0, unsigned DecomposeFactor=1) |
Wrapper call that will call into more specific compute masters functions that compute masters based on nodes, edges, or both. More... | |
void | readersFromFile (galois::graphs::OfflineGraph &g, std::string filename) |
reader assignment from a file corresponds to master assignment if using an edge cut More... | |
uint32_t | G2L (uint64_t gid) const |
uint64_t | L2G (uint32_t lid) const |
void | determineThreadRanges () |
Uses a pre-computed prefix sum to determine division of nodes among threads. More... | |
void | determineThreadRangesMaster () |
Determines the thread ranges for master nodes only and saves them to the object. More... | |
void | determineThreadRangesWithEdges () |
Determines the thread ranges for nodes with edges only and saves them to the object. More... | |
void | initializeSpecificRanges () |
Initializes the 3 range objects that a user can access to iterate over the graph in different ways. More... | |
void | edgesEqualMasters () |
Specific range editor: makes the range for edges equivalent to the range for masters. More... | |
Protected Attributes | |
GraphTy | graph |
The internal graph used by DistGraph to represent the graph. More... | |
bool | transposed |
Marks if the graph is transposed or not. More... | |
uint64_t | numGlobalNodes |
Total nodes in the global unpartitioned graph. More... | |
uint64_t | numGlobalEdges |
Total edges in the global unpartitioned graph. More... | |
uint32_t | numNodes |
Num nodes in this graph in total. More... | |
uint64_t | numEdges |
Num edges in this graph in total. More... | |
const unsigned | id |
ID of the machine. More... | |
const uint32_t | numHosts |
Total number of machines. More... | |
uint32_t | numOwned |
Number of nodes owned (masters) by this host. More... | |
uint32_t | beginMaster |
Local id of the beginning of master nodes. More... | |
uint32_t | numNodesWithEdges |
Number of nodes (masters + mirrors) that have outgoing edges. More... | |
std::vector< std::pair < uint64_t, uint64_t > > | gid2host |
Information that converts host to range of nodes that host reads. More... | |
std::vector< std::vector < size_t > > | mirrorNodes |
Mirror nodes from different hosts. For reduce. More... | |
std::vector< uint64_t > | localToGlobalVector |
GID = localToGlobalVector[LID]. More... | |
std::unordered_map< uint64_t, uint32_t > | globalToLocalMap |
LID = globalToLocalMap[GID]. More... | |
Base DistGraph class that all distributed graphs extend from.
NodeTy | type of node data for the graph |
EdgeTy | type of edge data for the graph |
using galois::graphs::DistGraph< NodeTy, EdgeTy >::const_iterator = typename GraphTy::const_iterator |
constant iterator type over nodes
using galois::graphs::DistGraph< NodeTy, EdgeTy >::edge_iterator = typename GraphTy::edge_iterator |
iterator type over edges
using galois::graphs::DistGraph< NodeTy, EdgeTy >::EdgeType = EdgeTy |
Expose EdgeTy to other classes.
using galois::graphs::DistGraph< NodeTy, EdgeTy >::GraphNode = typename GraphTy::GraphNode |
Type representing a node in this graph.
using galois::graphs::DistGraph< NodeTy, EdgeTy >::iterator = typename GraphTy::iterator |
iterator type over nodes
|
inline |
Constructor for DistGraph.
Initializes metadata fields.
host | host number that this graph resides on |
numHosts | total number of hosts in the currently executing program |
|
inline |
Returns a range object that encapsulates all nodes of the graph.
|
inline |
Returns a range object that encapsulates master nodes and nodes with edges in this graph.
|
inlinevirtual |
Returns Cartesian split (if it exists, else returns pair of 0s.
Reimplemented in galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >.
|
inlineprotected |
Wrapper call that will call into more specific compute masters functions that compute masters based on nodes, edges, or both.
masters_distribution | method of masters distribution to use |
g | The offline graph which has loaded the graph you want to get the masters for |
scalefactor | A vector that specifies if a particular host should have more or less than other hosts |
nodeWeight | weight to give nodes when computing balance |
edgeWeight | weight to give edges when computing balance |
DecomposeFactor | Specifies how decomposed the blocking of nodes should be. For example, a factor of 2 will make 2 blocks out of 1 block had the decompose factor been set to 1. |
|
inline |
Deallocates underlying LC CSR Graph.
|
inlineprotected |
Uses a pre-computed prefix sum to determine division of nodes among threads.
The call uses binary search to determine the ranges.
|
inlineprotected |
Determines the thread ranges for master nodes only and saves them to the object.
Only call after graph is constructed + only call once
|
inlineprotected |
Determines the thread ranges for nodes with edges only and saves them to the object.
Only call after graph is constructed + only call once
|
inline |
Gets the first edge of some node.
N | node to get the edge of |
|
inline |
Gets the end edge boundary of some node.
N | node to get the edge of |
|
inline |
Returns an iterable object over the edges of a particular node in the graph.
N | node to get edges iterator over |
|
inlineprotected |
Specific range editor: makes the range for edges equivalent to the range for masters.
|
inlineprotected |
Returns evilPhase + 1, handling loop around as necessary.
|
inlineprotected |
|
inline |
Get data of a node.
N | node to get the data of |
mflag | access flag for node data |
|
inline |
Get the edge data for a particular edge in the graph.
ni | edge to get the data of |
mflag | access flag for edge data |
|
inline |
Gets edge destination of edge ni.
ni | edge id to get destination of |
|
inline |
Converts a local node id into a global node id.
nodeID | local node id |
|
pure virtual |
Determines which host has the master for a particular node.
Implemented in galois::graphs::MiningGraph< NodeTy, EdgeTy, Partitioner >, and galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >.
|
inline |
Converts a global node id into a local node id.
nodeID | global node id |
|
inline |
|
inline |
Return a vector of pairs denoting mirror node ranges.
Assumes all mirror nodes occur after the masters: this invariant should be held by CuSP.
|
inline |
Gets number of nodes with edges (may include nodes without edges) on this (local) graph.
|
inline |
Gets number of nodes on the global unpartitioned graph.
|
inline |
Gets number of edges on the global unpartitioned graph.
|
inlineprotected |
Increments evilPhase, a phase counter used by communication.
|
inlineprotected |
Initializes the 3 range objects that a user can access to iterate over the graph in different ways.
|
pure virtual |
Returns true if current partition is a vertex cut.
Implemented in galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >.
|
pure virtual |
Determine if a node has a proxy on this host.
Implemented in galois::graphs::MiningGraph< NodeTy, EdgeTy, Partitioner >, and galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >.
|
pure virtual |
Determine if a node has a master on this host.
Implemented in galois::graphs::MiningGraph< NodeTy, EdgeTy, Partitioner >, and galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >.
|
inline |
|
inlineprotected |
|
inline |
Returns a range object that encapsulates only master nodes in this graph.
|
inline |
Gets number of nodes on this (local) graph.
|
inline |
Read the local LC_CSR graph from the file on a disk.
|
inlineprotected |
reader assignment from a file corresponds to master assignment if using an edge cut
|
inline |
Write the local LC_CSR graph to the file on a disk.
|
inline |
Gets number of nodes on this (local) graph.
|
inline |
Gets number of edges on this (local) graph.
|
inline |
Sort the underlying LC_CSR_Graph by ID (destinations) It sorts edges of the nodes by destination.
|
protected |
Local id of the beginning of master nodes.
beginMaster + numOwned = local id of the end of master nodes
|
protected |
Information that converts host to range of nodes that host reads.
|
protected |
LID = globalToLocalMap[GID].
|
protected |
The internal graph used by DistGraph to represent the graph.
|
protected |
ID of the machine.
|
protected |
GID = localToGlobalVector[LID].
|
protected |
Mirror nodes from different hosts. For reduce.
|
protected |
Num edges in this graph in total.
|
protected |
Total edges in the global unpartitioned graph.
|
protected |
Total nodes in the global unpartitioned graph.
|
protected |
Total number of machines.
|
protected |
Num nodes in this graph in total.
|
protected |
Number of nodes (masters + mirrors) that have outgoing edges.
|
protected |
Number of nodes owned (masters) by this host.
size() - numOwned = mirrors on this host
|
protected |
Marks if the graph is transposed or not.