Local computation graph that allows addition of nodes (but not removals) if the maximum degree of a node is known at the time it is added.
More...
|
| ~LC_Morph_Graph () |
| Destructor. More...
|
|
node_data_reference | getData (const GraphNode &N, MethodFlag mflag=MethodFlag::WRITE) |
| Get the data of a node N. More...
|
|
edge_data_reference | getEdgeData (edge_iterator ni, MethodFlag mflag=MethodFlag::UNPROTECTED) |
| Get edge data of an edge given an iterator to the edge. More...
|
|
GraphNode | getEdgeDst (edge_iterator ni) |
| Get the destination of an edge given an iterator to the edge. More...
|
|
iterator | begin () |
| Returns an iterator to all the nodes in the graph. More...
|
|
iterator | end () |
| Returns the end of the node iterator. Not thread-safe. More...
|
|
local_iterator | local_begin () |
| Return an iterator to the beginning of the local nodes of the graph. More...
|
|
local_iterator | local_end () |
| Return an iterator to the end of the local nodes of the graph. More...
|
|
edge_iterator | edge_begin (GraphNode N, MethodFlag mflag=MethodFlag::WRITE) |
| Return an iterator to the first edge of a particular node. More...
|
|
edge_iterator | edge_end (GraphNode N, MethodFlag GALOIS_UNUSED(mflag)=MethodFlag::WRITE) |
| Return an iterator to the end of edges of a particular node. More...
|
|
runtime::iterable
< NoDerefIterator
< edge_iterator > > | edges (GraphNode N, MethodFlag mflag=MethodFlag::WRITE) |
| Return a range for edges of a node for use by C++ for_each loops. More...
|
|
internal::EdgesIterator
< LC_Morph_Graph > | out_edges (GraphNode N, MethodFlag mflag=MethodFlag::WRITE) |
| Returns an object with begin() and end() methods to iterate over the outgoing edges of N. More...
|
|
template<typename... Args> |
GraphNode | createNode (int nedges, Args &&...args) |
| Creates a new node with a cap on the number of edges. More...
|
|
template<typename... Args> |
edge_iterator | addEdge (GraphNode src, GraphNode dst, galois::MethodFlag mflag, Args &&...args) |
| Adds an edge if it doesn't already exist. More...
|
|
template<typename... Args> |
edge_iterator | addMultiEdge (GraphNode src, GraphNode dst, galois::MethodFlag mflag, Args &&...args) |
| Construct a new edge for a node. More...
|
|
void | removeEdge (GraphNode src, edge_iterator dst, galois::MethodFlag mflag=MethodFlag::WRITE) |
| Remove an edge from the graph. More...
|
|
edge_iterator | findEdge (GraphNode src, GraphNode dst, galois::MethodFlag mflag=MethodFlag::WRITE) |
| Finds an edge between 2 nodes and returns the iterator to it if it exists. More...
|
|
void | allocateFrom (FileGraph &graph, ReadGraphAuxData &aux) |
| Allocate memory for nodes given a file graph with a particular number of nodes. More...
|
|
void | constructNodesFrom (FileGraph &graph, unsigned tid, unsigned total, ReadGraphAuxData &aux) |
| Constructs the LCMorphGraph nodes given a FileGraph to construct it from. More...
|
|
void | constructEdgesFrom (FileGraph &graph, unsigned tid, unsigned total, const ReadGraphAuxData &aux) |
| Constructs the LCMorphGraph edges given a FileGraph to construct it from and pointers to already created nodes. More...
|
|
|
template<bool _A1 = HasNoLockable, bool _A2 = HasOutOfLineLockable> |
void | acquireNode (GraphNode N, MethodFlag mflag, typename std::enable_if<!_A1 &&!_A2 >::type *=0) |
| Acquire a node for the scope in which the function is called. More...
|
|
template<bool _A1 = HasOutOfLineLockable, bool _A2 = HasNoLockable> |
void | acquireNode (GraphNode N, MethodFlag mflag, typename std::enable_if< _A1 &&!_A2 >::type *=0) |
| Acquire a node for the scope in which the function is called. More...
|
|
template<bool _A1 = EdgeInfo::has_value, bool _A2 = LargeArray<FileEdgeTy>::has_value> |
void | constructEdgeValue (FileGraph &graph, typename FileGraph::edge_iterator nn, GraphNode src, GraphNode dst, typename std::enable_if<!_A1||_A2 >::type *=0) |
| Given a FileGraph and an edge in it, add it to the LCMorphGraph. More...
|
|
template<bool _A1 = EdgeInfo::has_value, bool _A2 = LargeArray<FileEdgeTy>::has_value> |
void | constructEdgeValue (FileGraph &, typename FileGraph::edge_iterator, GraphNode src, GraphNode dst, typename std::enable_if< _A1 &&!_A2 >::type *=0) |
| Given a FileGraph and an edge in it, add it to the LCMorphGraph. More...
|
|
template<bool _A1 = HasOutOfLineLockable, bool _A2 = HasNoLockable> |
void | acquireNode (GraphNode, MethodFlag, typename std::enable_if< _A2 >::type *=0) |
| No-op acquire node when HasNoLockable is true. More...
|
|
template<bool _Enable = HasId> |
size_t | getId (GraphNode N, typename std::enable_if< _Enable >::type *=0) |
| Get the ID of a graph node if they're enabled in the class. More...
|
|
template<typename NodeTy, typename EdgeTy, bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
class galois::graphs::LC_Morph_Graph< NodeTy, EdgeTy, HasNoLockable, UseNumaAlloc, HasOutOfLineLockable, HasId, FileEdgeTy >
Local computation graph that allows addition of nodes (but not removals) if the maximum degree of a node is known at the time it is added.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Destructor.
If edges have some value, destory all of it (i.e. free up memory).
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<bool _A1 = HasNoLockable, bool _A2 = HasOutOfLineLockable>
Acquire a node for the scope in which the function is called.
- Parameters
-
N | node to acquire |
mflag | Method flag specifying type of acquire (e.g. read, write, etc.) |
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<bool _A1 = HasOutOfLineLockable, bool _A2 = HasNoLockable>
Acquire a node for the scope in which the function is called.
The lock is out of line (not local to the node).
- Parameters
-
N | node to acquire |
mflag | Method flag specifying type of acquire (e.g. read, write, etc.) |
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<bool _A1 = HasOutOfLineLockable, bool _A2 = HasNoLockable>
No-op acquire node when HasNoLockable is true.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<typename... Args>
Adds an edge if it doesn't already exist.
- Parameters
-
src | Source to add edge to |
dst | Destination to add edge to |
mflag | Method flag specifying type of acquire (e.g. read, write) |
args | Arguments needed to construct an edge |
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<typename... Args>
Construct a new edge for a node.
Can add duplicate edges.
- Parameters
-
src | Source node to add edge to |
dst | Destination node of new edge |
mflag | Method flag specifying type of acquire (e.g. read, write) |
args | Other arguments that need to be passed in to construct a new edge |
- Returns
- Iterator to newly added edge
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Allocate memory for nodes given a file graph with a particular number of nodes.
This graph will allocate out of line space for that number of nodes as well.
- Parameters
-
graph | FileGraph with a number of nodes to allocate |
aux | Data structure in which to allocate space for nodes. |
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Returns an iterator to all the nodes in the graph.
Not thread-safe.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Constructs the LCMorphGraph edges given a FileGraph to construct it from and pointers to already created nodes.
Meant to be called by multiple threads.
- Parameters
-
[in] | graph | FileGraph to construct a morph graph from |
[in] | tid | Thread id of thread calling this function |
[in] | total | Total number of threads in current execution |
[in] | aux | Contains pointers to already created nodes to create edges for. |
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<bool _A1 = EdgeInfo::has_value, bool _A2 = LargeArray<FileEdgeTy>::has_value>
void galois::graphs::LC_Morph_Graph< NodeTy, EdgeTy, HasNoLockable, UseNumaAlloc, HasOutOfLineLockable, HasId, FileEdgeTy >::constructEdgeValue |
( |
FileGraph & |
graph, |
|
|
typename FileGraph::edge_iterator |
nn, |
|
|
GraphNode |
src, |
|
|
GraphNode |
dst, |
|
|
typename std::enable_if<!_A1||_A2 >::type * |
= 0 |
|
) |
| |
|
inlineprotected |
Given a FileGraph and an edge in it, add it to the LCMorphGraph.
Can handle edge weights.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<bool _A1 = EdgeInfo::has_value, bool _A2 = LargeArray<FileEdgeTy>::has_value>
void galois::graphs::LC_Morph_Graph< NodeTy, EdgeTy, HasNoLockable, UseNumaAlloc, HasOutOfLineLockable, HasId, FileEdgeTy >::constructEdgeValue |
( |
FileGraph & |
, |
|
|
typename FileGraph::edge_iterator |
, |
|
|
GraphNode |
src, |
|
|
GraphNode |
dst, |
|
|
typename std::enable_if< _A1 &&!_A2 >::type * |
= 0 |
|
) |
| |
|
inlineprotected |
Given a FileGraph and an edge in it, add it to the LCMorphGraph.
Does not handle edge weights.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Constructs the LCMorphGraph nodes given a FileGraph to construct it from.
Meant to be called by multiple threads.
- Parameters
-
[in] | graph | FileGraph to construct a morph graph from |
[in] | tid | Thread id of thread calling this function |
[in] | total | Total number of threads in current execution |
[in,out] | aux | Allocated memory to store pointers to the created nodes |
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<typename... Args>
Creates a new node with a cap on the number of edges.
- Parameters
-
nedges | Number of edges reserved for this node. |
args | Arguments required to construct a new node |
- Returns
- Newly created node
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Returns the end of the node iterator. Not thread-safe.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<bool _Enable = HasId>
size_t galois::graphs::LC_Morph_Graph< NodeTy, EdgeTy, HasNoLockable, UseNumaAlloc, HasOutOfLineLockable, HasId, FileEdgeTy >::getId |
( |
GraphNode |
N, |
|
|
typename std::enable_if< _Enable >::type * |
= 0 |
|
) |
| |
|
inlineprotected |
Get the ID of a graph node if they're enabled in the class.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Return an iterator to the beginning of the local nodes of the graph.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
Return an iterator to the end of the local nodes of the graph.
template<typename NodeTy , typename EdgeTy , bool HasNoLockable = false, bool UseNumaAlloc = false, bool HasOutOfLineLockable = false, bool HasId = false, typename FileEdgeTy = EdgeTy>
template<typename Graph >