forked from zongshenmu/GraphPartitioners
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbh.hpp
More file actions
52 lines (41 loc) · 1.02 KB
/
Copy pathdbh.hpp
File metadata and controls
52 lines (41 loc) · 1.02 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
//
// Created by muzongshen on 2021/9/23.
//
#pragma once
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
#include <random>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include "dense_bitset.hpp"
#include "util.hpp"
#include "partitioner.hpp"
using namespace std;
class DbhPartitioner : public Partitioner
{
private:
vid_t num_vertices;
size_t num_edges;
size_t filesize;
int p;
ifstream fin;
std::vector<vid_t> degrees;
uint32_t num_batches;
uint32_t num_edges_per_batch;
dense_bitset true_vids;;
std::vector<dense_bitset> is_mirrors;
std::vector<size_t> counter;
vector<vector<vid_t>> part_degrees;
vector<int> balance_vertex_distribute;
protected:
void read_and_do(string opt_name);
void batch_dbh(vector<edge_t> &edges);
void batch_node_assignment(vector<edge_t> &edges);
public:
DbhPartitioner(string basefilename, string method, int pnum, int memsize, bool shuffle);
void split();
};