-
Notifications
You must be signed in to change notification settings - Fork 4
/
Meta.h
73 lines (60 loc) · 1.96 KB
/
Meta.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef __META_H__
#define __META_H__
#include <iostream>
#include <string>
enum AlgoType{
REVERSE_PUSH = 0,
kAlgoTypeSize
};
enum VariantType{
OPTIMIZED = 0,
FAST_FRONTIER = 1,
EAGER = 2,
VANILLA= 3,
kVariantTypeSize
};
enum WorkloadConfigType{
// the slide size is a ratio of the window size, e.g. 1%, 0.1%, 0.01%
SLIDE_WINDOW_RATIO,
// the slide size is given as a number of edges, e.g. 10^5
SLIDE_BATCH_SIZE
};
typedef double ValueType;
typedef int IndexType;
const static IndexType kMinVertexId = 0;
const static IndexType kMaxVertexId = 1000000000;
const static ValueType ALPHA = 0.15; // which is REST_PROB
const static size_t kMasterThreadId = 0;
const static IndexType DEFAULT_SOURCE_VERTEX_ID = 1;
//GPU
const static size_t THREADS_PER_BLOCK = 256;
const static size_t THREADS_PER_WARP = 32;
const static size_t MAX_BLOCKS_NUM = 96 * 8;
const static size_t MAX_THREADS_NUM = MAX_BLOCKS_NUM * THREADS_PER_BLOCK;
//CPU
const static size_t VERTEX_DEGREE_THRESHOLD = 512;
// ============== parameter ==============
// general
extern std::string gDataFileName;
extern int gAppType;
extern int gIsDirected;
extern int gIsDynamic;
// workload
extern double gWindowRatio;
extern int gWorkloadConfigType;
// in either workload, gStreamBatchCount, gStreamUpdateCountPerBatch and gStreamUpdateCountTotal will be used in execution
// for SLIDE_WINDOW_RATIO
extern double gStreamUpdateCountVersusWindowRatio;
extern size_t gStreamBatchCount;
// for SLIDE_BATCH_SIZE
extern size_t gStreamUpdateCountPerBatch;
extern size_t gStreamUpdateCountTotal;
extern int gSourceVertexId;
// execution
extern int gThreadNum;
extern int gVariant;
// epsilon
extern ValueType gTolerance;
#define CALC_BLOCKS_NUM(ITEMS_PER_BLOCK, CALC_SIZE) MAX_BLOCKS_NUM < ((CALC_SIZE - 1) / ITEMS_PER_BLOCK + 1) ? MAX_BLOCKS_NUM : ((CALC_SIZE - 1) / ITEMS_PER_BLOCK + 1)
//#define CALC_THREAD_BIN_SIZE(vertex_count, max_threads_num) ((vertex_count - 1) / max_threads_num + 1)
#endif