Graph serialized to a file. More...
#include <FileGraph.h>
Classes | |
struct | Convert32 |
struct | Convert64 |
Public Types | |
typedef uint32_t | GraphNode |
typedef boost::counting_iterator < uint64_t > | edge_iterator |
typedef boost::transform_iterator < Convert32, uint32_t * > | neighbor_iterator |
typedef boost::transform_iterator < Convert32, uint32_t * > | node_id_iterator |
typedef boost::transform_iterator < Convert64, uint64_t * > | edge_id_iterator |
typedef boost::counting_iterator < uint64_t > | iterator |
Public Member Functions | |
bool | containsNode (const GraphNode n) const |
Checks if a node is in the graph (already added). | |
template<typename EdgeTy > | |
EdgeTy & | getEdgeData (GraphNode src, GraphNode dst) |
edge_iterator | edge_begin (GraphNode N) const |
edge_iterator | edge_end (GraphNode N) const |
detail::EdgesWithNoFlagIterator < FileGraph > | out_edges (GraphNode N) |
template<typename EdgeTy , typename CompTy > | |
void | sortEdgesByEdgeData (GraphNode N, const CompTy &comp=std::less< EdgeTy >()) |
Sorts outgoing edges of a node. | |
template<typename EdgeTy , typename CompTy > | |
void | sortEdges (GraphNode N, const CompTy &comp) |
Sorts outgoing edges of a node. | |
template<typename EdgeTy > | |
EdgeTy & | getEdgeData (edge_iterator it) const |
GraphNode | getEdgeDst (edge_iterator it) const |
neighbor_iterator | neighbor_begin (GraphNode N) const |
neighbor_iterator | neighbor_end (GraphNode N) const |
template<typename EdgeTy > | |
EdgeTy * | edge_data_begin () const |
template<typename EdgeTy > | |
EdgeTy * | edge_data_end () const |
iterator | begin () const |
iterator | end () const |
std::pair< iterator, iterator > | divideBy (size_t nodeSize, size_t edgeSize, unsigned id, unsigned total) |
Divides nodes into balanced ranges. | |
node_id_iterator | node_id_begin () const |
node_id_iterator | node_id_end () const |
edge_id_iterator | edge_id_begin () const |
edge_id_iterator | edge_id_end () const |
template<typename EdgeTy > | |
EdgeTy & | getEdgeData (neighbor_iterator it) |
bool | hasNeighbor (GraphNode N1, GraphNode N2) const |
unsigned int | size () const |
Returns the number of nodes in the graph. | |
unsigned int | sizeEdges () const |
Returns the number of edges in the graph. | |
size_t | edgeSize () const |
Returns the size of an edge. | |
FileGraph () | |
~FileGraph () | |
void | structureFromFile (const std::string &filename, bool preFault=true) |
Reads graph connectivity information from file. | |
void | structureFromFileInterleaved (const std::string &filename, size_t sizeofEdgeData) |
Reads graph connectivity information from file. | |
template<typename EdgeTy > | |
void | structureFromFileInterleaved (const std::string &filename, typename std::enable_if<!std::is_void< EdgeTy >::value >::type *=0) |
template<typename EdgeTy > | |
void | structureFromFileInterleaved (const std::string &filename, typename std::enable_if< std::is_void< EdgeTy >::value >::type *=0) |
template<typename T > | |
T * | structureFromArrays (uint64_t *outIdxs, uint64_t numNodes, uint32_t *outs, uint64_t numEdges) |
Reads graph connectivity information from arrays. | |
template<typename T > | |
T * | structureFromGraph (FileGraph &g) |
Reads graph connectivity information from arrays. | |
void | structureToFile (const std::string &file) |
Writes graph connectivity information to file. | |
void | swap (FileGraph &other) |
void | cloneFrom (FileGraph &other) |
Protected Member Functions | |
uint64_t | getEdgeIdx (GraphNode src, GraphNode dst) const |
uint32_t * | raw_neighbor_begin (GraphNode N) const |
uint32_t * | raw_neighbor_end (GraphNode N) const |
void | parse (void *m) |
Initializes a graph from block of memory. | |
void | structureFromMem (void *mem, size_t len, bool clone) |
Reads graph connectivity information from memory. | |
void * | structureFromArrays (uint64_t *outIdxs, uint64_t numNodes, uint32_t *outs, uint64_t numEdges, size_t sizeofEdgeData) |
void * | structureFromGraph (FileGraph &g, size_t sizeofEdgeData) |
size_t | findIndex (size_t nodeSize, size_t edgeSize, size_t targetSize, size_t lb, size_t ub) |
Finds the first node N such that. | |
Protected Attributes | |
void *volatile | masterMapping |
size_t | masterLength |
uint64_t | sizeofEdge |
int | masterFD |
uint64_t * | outIdx |
uint32_t * | outs |
char * | edgeData |
uint64_t | numEdges |
uint64_t | numNodes |
Friends | |
class | FileGraphAllocator |
Graph serialized to a file.
typedef boost::transform_iterator<Convert64, uint64_t*> Galois::Graph::FileGraph::edge_id_iterator |
typedef boost::counting_iterator<uint64_t> Galois::Graph::FileGraph::edge_iterator |
typedef uint32_t Galois::Graph::FileGraph::GraphNode |
typedef boost::counting_iterator<uint64_t> Galois::Graph::FileGraph::iterator |
typedef boost::transform_iterator<Convert32, uint32_t*> Galois::Graph::FileGraph::neighbor_iterator |
typedef boost::transform_iterator<Convert32, uint32_t*> Galois::Graph::FileGraph::node_id_iterator |
FileGraph::FileGraph | ( | ) |
FileGraph::~FileGraph | ( | ) |
FileGraph::iterator FileGraph::begin | ( | ) | const |
void FileGraph::cloneFrom | ( | FileGraph & | other | ) |
bool Galois::Graph::FileGraph::containsNode | ( | const GraphNode | n | ) | const [inline] |
Checks if a node is in the graph (already added).
auto FileGraph::divideBy | ( | size_t | nodeSize, | |
size_t | edgeSize, | |||
unsigned | id, | |||
unsigned | total | |||
) |
Divides nodes into balanced ranges.
FileGraph::edge_iterator FileGraph::edge_begin | ( | GraphNode | N | ) | const |
EdgeTy* Galois::Graph::FileGraph::edge_data_begin | ( | ) | const [inline] |
EdgeTy* Galois::Graph::FileGraph::edge_data_end | ( | ) | const [inline] |
FileGraph::edge_iterator FileGraph::edge_end | ( | GraphNode | N | ) | const |
FileGraph::edge_id_iterator FileGraph::edge_id_begin | ( | ) | const |
FileGraph::edge_id_iterator FileGraph::edge_id_end | ( | ) | const |
size_t Galois::Graph::FileGraph::edgeSize | ( | ) | const [inline] |
Returns the size of an edge.
FileGraph::iterator FileGraph::end | ( | ) | const |
size_t FileGraph::findIndex | ( | size_t | nodeSize, | |
size_t | edgeSize, | |||
size_t | targetSize, | |||
size_t | lb, | |||
size_t | ub | |||
) | [protected] |
Finds the first node N such that.
N * nodeSize + (sum_{i=0}^{N-1} E[i]) * edgeSize >= targetSize
in range [lb, ub). Returns ub if unsuccessful.
EdgeTy& Galois::Graph::FileGraph::getEdgeData | ( | neighbor_iterator | it | ) | [inline] |
EdgeTy& Galois::Graph::FileGraph::getEdgeData | ( | edge_iterator | it | ) | const [inline] |
EdgeTy& Galois::Graph::FileGraph::getEdgeData | ( | GraphNode | src, | |
GraphNode | dst | |||
) | [inline] |
FileGraph::GraphNode FileGraph::getEdgeDst | ( | edge_iterator | it | ) | const |
neighbor_iterator Galois::Graph::FileGraph::neighbor_begin | ( | GraphNode | N | ) | const [inline] |
neighbor_iterator Galois::Graph::FileGraph::neighbor_end | ( | GraphNode | N | ) | const [inline] |
FileGraph::node_id_iterator FileGraph::node_id_begin | ( | ) | const |
FileGraph::node_id_iterator FileGraph::node_id_end | ( | ) | const |
detail::EdgesWithNoFlagIterator<FileGraph> Galois::Graph::FileGraph::out_edges | ( | GraphNode | N | ) | [inline] |
void FileGraph::parse | ( | void * | m | ) | [protected] |
Initializes a graph from block of memory.
uint32_t * FileGraph::raw_neighbor_begin | ( | GraphNode | N | ) | const [protected] |
uint32_t * FileGraph::raw_neighbor_end | ( | GraphNode | N | ) | const [protected] |
unsigned int Galois::Graph::FileGraph::size | ( | ) | const [inline] |
Returns the number of nodes in the graph.
unsigned int Galois::Graph::FileGraph::sizeEdges | ( | ) | const [inline] |
Returns the number of edges in the graph.
void Galois::Graph::FileGraph::sortEdges | ( | GraphNode | N, | |
const CompTy & | comp | |||
) | [inline] |
Sorts outgoing edges of a node.
Comparison function is over EdgeSortValue<EdgeTy>
.
void Galois::Graph::FileGraph::sortEdgesByEdgeData | ( | GraphNode | N, | |
const CompTy & | comp = std::less<EdgeTy>() | |||
) | [inline] |
Sorts outgoing edges of a node.
Comparison function is over EdgeTy.
T* Galois::Graph::FileGraph::structureFromArrays | ( | uint64_t * | outIdxs, | |
uint64_t | numNodes, | |||
uint32_t * | outs, | |||
uint64_t | numEdges | |||
) | [inline] |
Reads graph connectivity information from arrays.
Returns a pointer to array to populate with edge data.
void * FileGraph::structureFromArrays | ( | uint64_t * | outIdxs, | |
uint64_t | numNodes, | |||
uint32_t * | outs, | |||
uint64_t | numEdges, | |||
size_t | sizeofEdgeData | |||
) | [protected] |
void FileGraph::structureFromFile | ( | const std::string & | filename, | |
bool | preFault = true | |||
) |
Reads graph connectivity information from file.
void Galois::Graph::FileGraph::structureFromFileInterleaved | ( | const std::string & | filename, | |
typename std::enable_if< std::is_void< EdgeTy >::value >::type * | = 0 | |||
) | [inline] |
void Galois::Graph::FileGraph::structureFromFileInterleaved | ( | const std::string & | filename, | |
typename std::enable_if<!std::is_void< EdgeTy >::value >::type * | = 0 | |||
) | [inline] |
void Galois::Graph::FileGraph::structureFromFileInterleaved | ( | const std::string & | filename, | |
size_t | sizeofEdgeData | |||
) |
Reads graph connectivity information from file.
Tries to balance memory evenly across system. Cannot be called during parallel execution.
T* Galois::Graph::FileGraph::structureFromGraph | ( | FileGraph & | g | ) | [inline] |
Reads graph connectivity information from arrays.
Returns a pointer to array to populate with edge data.
void * FileGraph::structureFromGraph | ( | FileGraph & | g, | |
size_t | sizeofEdgeData | |||
) | [protected] |
void FileGraph::structureFromMem | ( | void * | mem, | |
size_t | len, | |||
bool | clone | |||
) | [protected] |
Reads graph connectivity information from memory.
void FileGraph::structureToFile | ( | const std::string & | file | ) |
Writes graph connectivity information to file.
void FileGraph::swap | ( | FileGraph & | other | ) |
friend class FileGraphAllocator [friend] |
char* Galois::Graph::FileGraph::edgeData [protected] |
int Galois::Graph::FileGraph::masterFD [protected] |
size_t Galois::Graph::FileGraph::masterLength [protected] |
void* volatile Galois::Graph::FileGraph::masterMapping [protected] |
uint64_t Galois::Graph::FileGraph::numEdges [protected] |
uint64_t Galois::Graph::FileGraph::numNodes [protected] |
uint64_t* Galois::Graph::FileGraph::outIdx [protected] |
Reimplemented in Galois::Graph::FileGraphWriter.
uint32_t* Galois::Graph::FileGraph::outs [protected] |
Reimplemented in Galois::Graph::FileGraphWriter.
uint64_t Galois::Graph::FileGraph::sizeofEdge [protected] |