Galois
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner > Class Template Reference

#include <NewGeneric.h>

Inheritance diagram for galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >:
galois::graphs::DistGraph< NodeTy, EdgeTy >

Public Types

using base_DistGraph = DistGraph< NodeTy, EdgeTy >
 typedef for base DistGraph class More...
 
- Public Types inherited from galois::graphs::DistGraph< NodeTy, EdgeTy >
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

virtual unsigned getHostID (uint64_t gid) const
 Determines which host has the master for a particular node. More...
 
virtual bool isOwned (uint64_t gid) const
 Determine if a node has a master on this host. More...
 
virtual bool isLocal (uint64_t gid) const
 Determine if a node has a proxy on this host. More...
 
virtual bool is_vertex_cut () const
 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...
 
void resetEdgeLoad ()
 Reset load balance on host reducibles. More...
 
void syncEdgeLoad ()
 Sync load balance on hosts using reducibles. More...
 
void printEdgeLoad ()
 Debug function: prints host loads. More...
 
 NewDistGraphGeneric (const std::string &filename, unsigned host, unsigned _numHosts, bool cuspAsync=true, uint32_t stateRounds=100, bool transpose=false, galois::graphs::MASTERS_DISTRIBUTION md=BALANCED_EDGES_OF_MASTERS, uint32_t nodeWeight=0, uint32_t edgeWeight=0, std::string masterBlockFile="", bool readFromFile=false, std::string localGraphFileName="local_graph", uint32_t edgeStateRounds=1)
 Constructor. More...
 
 ~NewDistGraphGeneric ()
 Free the graph partitioner. More...
 
- Public Member Functions inherited from galois::graphs::DistGraph< NodeTy, EdgeTy >
 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 ()
 
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 NodeRangeTypeallNodesRange () const
 Returns a range object that encapsulates all nodes of the graph. More...
 
const NodeRangeTypemasterNodesRange () const
 Returns a range object that encapsulates only master nodes in this graph. More...
 
const NodeRangeTypeallNodesWithEdgesRange () 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...
 

Additional Inherited Members

- Protected Member Functions inherited from galois::graphs::DistGraph< NodeTy, EdgeTy >
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 inherited from galois::graphs::DistGraph< NodeTy, EdgeTy >
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...
 

Detailed Description

template<typename NodeTy, typename EdgeTy, typename Partitioner>
class galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >

Template Parameters
NodeTytype of node data for the graph
EdgeTytype of edge data for the graph
Warning
not meant for public use + not fully documented yet

Member Typedef Documentation

template<typename NodeTy , typename EdgeTy , typename Partitioner >
using galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::base_DistGraph = DistGraph<NodeTy, EdgeTy>

typedef for base DistGraph class

Constructor & Destructor Documentation

template<typename NodeTy , typename EdgeTy , typename Partitioner >
galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::NewDistGraphGeneric ( const std::string &  filename,
unsigned  host,
unsigned  _numHosts,
bool  cuspAsync = true,
uint32_t  stateRounds = 100,
bool  transpose = false,
galois::graphs::MASTERS_DISTRIBUTION  md = BALANCED_EDGES_OF_MASTERS,
uint32_t  nodeWeight = 0,
uint32_t  edgeWeight = 0,
std::string  masterBlockFile = "",
bool  readFromFile = false,
std::string  localGraphFileName = "local_graph",
uint32_t  edgeStateRounds = 1 
)
inline

Constructor.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::~NewDistGraphGeneric ( )
inline

Free the graph partitioner.

Member Function Documentation

template<typename NodeTy , typename EdgeTy , typename Partitioner >
virtual std::pair<unsigned, unsigned> galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::cartesianGrid ( ) const
inlinevirtual

Returns Cartesian split (if it exists, else returns pair of 0s.

Reimplemented from galois::graphs::DistGraph< NodeTy, EdgeTy >.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
virtual unsigned galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::getHostID ( uint64_t  ) const
inlinevirtual

Determines which host has the master for a particular node.

Returns
Host id of node in question

Implements galois::graphs::DistGraph< NodeTy, EdgeTy >.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
virtual bool galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::is_vertex_cut ( ) const
inlinevirtual

Returns true if current partition is a vertex cut.

Returns
true if partition being stored in this graph is a vertex cut

Implements galois::graphs::DistGraph< NodeTy, EdgeTy >.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
virtual bool galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::isLocal ( uint64_t  ) const
inlinevirtual

Determine if a node has a proxy on this host.

Returns
True if passed in global id has a proxy on this host

Implements galois::graphs::DistGraph< NodeTy, EdgeTy >.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
virtual bool galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::isOwned ( uint64_t  ) const
inlinevirtual

Determine if a node has a master on this host.

Returns
True if passed in global id has a master on this host

Implements galois::graphs::DistGraph< NodeTy, EdgeTy >.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
void galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::printEdgeLoad ( )
inline

Debug function: prints host loads.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
void galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::resetEdgeLoad ( )
inline

Reset load balance on host reducibles.

template<typename NodeTy , typename EdgeTy , typename Partitioner >
void galois::graphs::NewDistGraphGeneric< NodeTy, EdgeTy, Partitioner >::syncEdgeLoad ( )
inline

Sync load balance on hosts using reducibles.


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