-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbench_erdos_renyi.cpp
121 lines (106 loc) · 2.48 KB
/
bench_erdos_renyi.cpp
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#include "benchmark_dist.hpp"
#include <string>
using namespace std;
/*
* The main file is currently set up to benchmark the
* algorithms on Erdos-Reyi random matrices. The parameters
* are, in order,
*
* logM
* edgeFactor
* algorithm name
* R-value
* replication factor
* fused?
*/
int main(int argc, char** argv) {
MPI_Init(&argc, &argv);
initialize_mpi_datatypes();
int logM = atoi(argv[1]);
int edgeFactor = atoi(argv[2]);
string algorithm_name(argv[3]);
int R = atoi(argv[4]);
int c = atoi(argv[5]);
string output_file(argv[6]);
//string fused_string(argv[7]);
/*
bool fused;
if(fused_string == "fused") {
fused = true;
}
else if(fused_string == "unfused") {
fused = false;
}
else {
assert(false);
}
*/
string app = "vanilla";
string dummy = "";
SpmatLocal S;
S.loadTuples(false, logM, edgeFactor, dummy);
if(algorithm_name == "15d") {
benchmark_algorithm(&S,
"15d_fusion1",
output_file,
true,
R,
c,
app);
benchmark_algorithm(&S,
"15d_fusion2",
output_file,
true,
R,
c,
app);
/*benchmark_algorithm(&S,
"15d_fusion1",
output_file,
false,
R,
c,
app);*/
/*benchmark_algorithm(&S,
"15d_sparse",
output_file,
true,
R,
c,
app);*/
/*benchmark_algorithm(&S,
"15d_sparse",
output_file,
false,
R,
c,
app);*/
}
else if(algorithm_name == "25d") {
benchmark_algorithm(&S,
"25d_sparse_replicate",
output_file,
false,
R,
c,
app);
benchmark_algorithm(&S,
"25d_dense_replicate",
output_file,
true,
R,
c,
app);
/*benchmark_algorithm(&S,
"25d_dense_replicate",
output_file,
false,
R,
c,
app);*/
}
else {
assert(false);
}
MPI_Finalize();
}