forked from zongshenmu/GraphPartitioners
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
59 lines (51 loc) · 2 KB
/
main.cpp
File metadata and controls
59 lines (51 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//pnum "number of parititions"
//memsize "memory size in MB. Memsize is used as a chunk size if shuffling and batch size while partitioning"
//method "partition method"
//dataset "name of the dataset to construct graph."
//filename "name of the file to store edge list of a graph."
//shuffle "for streaming graph, influncing the partitioning quality"
#include <iostream>
#include "converter/conversions.hpp"
#include "converter/shuffler.hpp"
#include "util.hpp"
#include "ne_partitioner/ne.hpp"
#include "dbh.hpp"
#include "hdrf.hpp"
#include "streaming_vp/ldg.hpp"
#include "streaming_vp/fennel.hpp"
using namespace std;
int main() {
int pnum=150;
int memsize=4096;
string method="fennel";
double lambda=1.1;
double balance_ratio=1.05;
string edgename="/data0/mzs/Code/MPGraph/data/products/walks.txt";
bool shuffle=false;
google::InitGoogleLogging("main"); //参数为自己的可执行文件名
FLAGS_logtostderr = true;
// read the edges and change to binary format file
Converter* converter;
string binedgelist; // binary edgelist file
LOG(INFO) << "Using normal dataset";
converter = new Converter(edgename);
// LOG(INFO) << "Using shuffled dataset";
// converter = new Shuffler(edgename);
convert(edgename, converter, memsize);
Partitioner *partitioner = NULL;
if (method=="ne")
partitioner = new NePartitioner(edgename, method, pnum);
else if (method=="dbh")
partitioner = new DbhPartitioner(edgename, method, pnum, memsize, shuffle);
else if (method=="hdrf")
partitioner = new HdrfPartitioner(edgename,method,pnum,memsize,balance_ratio,lambda,shuffle);
else if (method=="ldg")
partitioner = new LdgPartitioner(edgename, method, pnum, memsize, shuffle);
else if (method=="fennel")
partitioner = new FennelPartitioner(edgename, method, pnum, memsize, shuffle);
else
LOG(ERROR) << "unkown method: " << method;
partitioner->split();
google::ShutdownGoogleLogging();
return 0;
}