EnGPar
Partitioning using the N-Graph
 All Classes Files Pages
binGraph.h
1 #ifndef _BIN_GRAPH__
2 #define _BIN_GRAPH__
3 
4 #include "ngraph.h"
5 #include <stdint.h>
6 
7 namespace agi {
8 
15 Ngraph* createBinGraph(char* graph_file,char* part_file =NULL);
16 
19 class binGraph : public Ngraph {
20  public:
21  // \cond INTERFACE
22  //Construct an empty binary graph
23  binGraph() : Ngraph() {}
24  //Construction for a partitioned example
25  // Part file contains partitioning
26  // If no file is given applies a vertex block partitioning
27  binGraph(char* graph_file,char* part_file=NULL);
28  void destroyData();
29 
30 
31  void migrate(std::map<GraphVertex*,part_t>&) {};
32  void migrate(agi::EdgePartitionMap&);
33  // \endcond
34  private:
35  //Loads edges from binary file
36  etype load_edges(FILE* f, int64_t*& read_edges, int64_t& m_read);
37  //Reads vertex owners from file
38  int read_ranks(char* filename,int32_t* ranks);
39  //Basic vertex block partitioning
40  int vert_block_ranks(int32_t* ranks);
41  //Exchanges the local edges to the correct processes
42  int exchange_edges(int64_t m_read, int64_t* read_edges,
43  int32_t* ranks,etype t);
44  //Creates the distributed csr
45  int create_dist_csr(int32_t* ranks,etype t,bool createGhost = true);
46 
47 
48 };
49 
50 }
51 
52 #endif
An extension of the N-Graph for binary graph files.
Definition: binGraph.h:19
The N-Graph interface.