Work-function to read a graph from the given input file.Uses the user-provided reader to read each line and add the edges from the line to the graph. More...
Public Member Functions | |
| template<typename Graph , typename LineReader > | |
| void | operator() (std::istream &ifs, LineReader const &line_reader, Graph *g, size_t blk_sz=4096, bool sharded=false) |
Work-function to read a graph from the given input file.
Uses the user-provided reader to read each line and add the edges from the line to the graph.
| void stapl::parallel_reader::operator() | ( | std::istream & | ifs, |
| LineReader const & | line_reader, | ||
| Graph * | g, | ||
| size_t | blk_sz = 4096, |
||
| bool | sharded = false |
||
| ) |
| ifs | The input file-stream. |
| line_reader | The functor used to read-in a line of text from file and add the appropriate edges to the provided aggregator, LineReader is given a stream with the line and an Edge-Aggregator. It should read the stream and add the appropriate edges to the provided Aggregator. LineReader should return '0' for success, '1' for failure. |
| g | A pointer to the output graph. Vertices must have been added apriory. |
| blk_sz | The size of the block (in number of lines), in which the input file will be partitioned to be read. |
| sharded | Indicates if the graph has been sharded across multiple files. |
1.8.13