-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_bench_out.cpp
More file actions
64 lines (53 loc) · 1.72 KB
/
parse_bench_out.cpp
File metadata and controls
64 lines (53 loc) · 1.72 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
60
61
62
63
64
#include <string>
#include <fstream>
#include <iostream>
#include <stdio.h>
using namespace std;
string push_file_name(int N, int P, int PK) {
return string("out_push.N_") +to_string(N)+ ".PK_" +to_string(PK)+ ".P_" +to_string(P);
}
string pull_file_name(int N, int P, int PK) {
return string("out_pull.N_") +to_string(N)+ ".PK_" +to_string(PK)+ ".P_" +to_string(P);
}
int main() {
int Ns[] = {5, 6, 7, 8, 9, 10};
int PKs[] = {20, 50};
int Ps[] = {0, 10, 50};
for(int i=0; i<2; i++) {
int PK = PKs[i];
for(int j=0; j<3; j++) {
int P = Ps[j];
printf("\n\nPK=%d, P=%d\n", PK, P);
cout << "PUSH" << endl;
for(int k=0; k<6; k++) {
int N = Ns[k];
ifstream file;
string filename = string("bench_push/") + push_file_name(N, P, PK);
file.open(filename.c_str());
float sum = 0;
int temp;
for(int x=0; x<N; x++) {
file >> temp;
sum += temp;
}
float avg = sum / float(N);
cout << avg << endl;
}
cout << endl << "PULL" << endl;
for(int k=0; k<6; k++) {
int N = Ns[k];
ifstream file;
string filename = string("bench_pull/") + pull_file_name(N, P, PK);
file.open(filename.c_str());
float sum = 0;
int temp;
for(int x=0; x<N; x++) {
file >> temp;
sum += temp;
}
float avg = sum / float(N);
cout << avg << endl;
}
}
}
}