52 #ifndef HAVOQGT_PARALLEL_EDGE_LIST_READER_INCLUDED
53 #define HAVOQGT_PARALLEL_EDGE_LIST_READER_INCLUDED
79 class input_iterator_type :
public std::iterator<std::input_iterator_tag, edge_type, ptrdiff_t, const edge_type*, const edge_type&> {
146 for(
size_t i=0; i<filenames.size(); ++i) {
147 if(i % mpi_size == mpi_rank) {
154 std::cout <<
"files open" << std::endl;
156 uint64_t local_max_vertex = 0;
159 local_max_vertex = std::max(edge.first, local_max_vertex);
160 local_max_vertex = std::max(edge.second, local_max_vertex);
193 std::stringstream ssline(line);
194 ssline >> edge.first >> edge.second;
209 std::ifstream* ptr =
new std::ifstream(*itr);
213 std::cerr <<
"Error opening filename: " << *itr;
227 #endif //HAVOQGT_PARALLEL_EDGE_LIST_READER_INCLUDED
std::vector< std::string > m_local_filenames
std::pair< uint64_t, uint64_t > edge_type
parallel_edge_list_reader(const std::vector< std::string > &filenames)
std::deque< std::ifstream * > m_ptr_ifstreams
const communicator & world_comm() const
uint64_t vertex_descriptor
input_iterator_type begin()
Returns the begin of the input iterator.
uint64_t m_global_max_vertex
T mpi_all_reduce(T in_d, Op in_op, MPI_Comm mpi_comm)
uint64_t m_local_edge_count
environment * havoqgt_env()
input_iterator_type end()
Returns the end of the input iterator.
#define HAVOQGT_ERROR_MSG(msg)
bool try_read_edge(edge_type &edge)