STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions
stapl::parallel_reader Struct Reference

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)
 

Detailed Description

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.

Member Function Documentation

◆ operator()()

template<typename Graph , typename LineReader >
void stapl::parallel_reader::operator() ( std::istream &  ifs,
LineReader const &  line_reader,
Graph *  g,
size_t  blk_sz = 4096,
bool  sharded = false 
)
Parameters
ifsThe input file-stream.
line_readerThe 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.
gA pointer to the output graph. Vertices must have been added apriory.
blk_szThe size of the block (in number of lines), in which the input file will be partitioned to be read.
shardedIndicates if the graph has been sharded across multiple files.

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