-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsummary-charts-template.html
executable file
·193 lines (174 loc) · 6.24 KB
/
summary-charts-template.html
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<html>
<head>
<title>green-haskell :: concurrent benchmark results</title>
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.css">
<style>
h1, p { color: #0E4EAD }
table { margin: 0 auto; border-spacing: 14px 2px }
.bench { width: 100%; margin: 0 auto; float: left; border-bottom: 2px solid #07093D; margin-bottom: 10px; text-align: center; }
.last { margin-bottom: 0px; }
.graph-container { width: 95%; margin: 0 auto; }
.graph { width: 49%; }
.graph img { width: 100%; }
.execution-time { float: left; }
.energy-consumption { float: right }
.hide64link { float: right }
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.10/c3.min.js"></script>
<script src="http:///cdn.jsdelivr.net/rxjs/2.5.3/rx.min.js"></script>
<script src="http://cdn.jsdelivr.net/rxjs/2.5.3/rx.aggregates.min.js"></script>
<script src="http://cdn.jsdelivr.net/rxjs-dom/6.0.0/rx.dom.min.js"></script>
</head>
<body>
<a class="hide64link" href="?hide64=true" target="_blank">Click here to see the charts without N=64</a>
<div class="bench">
<h1>[ system spec ]</h1>
<table>
<tbody>
<tr> <td>Processor model</td> <td>Intel(R) Xeon(R) E5-2660 v2</td> </tr>
<tr> <td>Clock</td> <td>2.20 GHz</td> </tr>
<tr> <td>Sockets</td> <td>2</td> </tr>
<tr> <td>Cores*</td> <td>10</td> </tr>
<tr> <td>Logical processors*</td> <td>20</td> </tr>
<tr> <td>L1 cache**</td> <td>320 KB</td> </tr>
<tr> <td>L2 cache**</td> <td>2.5 MB</td> </tr>
<tr> <td>L3 cache*</td> <td>25 MB</td> </tr>
<tr> <td>Memory</td> <td>256 GB DDR3 1600MHz</td> </tr>
<tr> <td>*per socket</td> <td>**per core</td> </tr>
</tbody>
</table>
</div>
<template id="bench-template">
<div class="bench">
<h1></h1>
<div class="graph-container">
<div class="graph execution-time"></div>
<div class="graph energy-consumption"></div>
</div>
</div>
</template>
<script>
var has64 = true;
if (window.location.search) {
var options = window.location.search;
has64 = !(options.indexOf("hide64=true") > -1);
if (!has64) {
var a = document.querySelector(".hide64link");
a.style.display = 'none';
}
}
var generateChartFor = function (benchDiv, data) {
var x_values = has64 ? ['x', 1, 2, 4, 8, 16, 20, 32, 40, 64]
: ['x', 1, 2, 4, 8, 16, 20, 32, 40];
var x_axis = {
min: 0,
label: {
text: 'Number of Capabilities',
position: 'outer-center'
}
};
var y_axis = function (label) {
return {
min: 0,
label: {
text: label,
position: 'outer-middle'
},
padding: { bottom: 0 }
};
};
c3.generate({
bindto: benchDiv.querySelector(".execution-time"),
data: {
x: 'x',
columns: [x_values].concat(data.time)
},
axis: {
x: x_axis,
y: y_axis('Time (sec)')
},
legend: { position: 'right' }
});
c3.generate({
bindto: benchDiv.querySelector(".energy-consumption"),
data: {
x: 'x',
columns: [x_values].concat(data.energy)
},
axis: {
x: x_axis,
y: y_axis('Energy consumption (joules)')
},
legend: { position: 'right' }
});
};
var parseData = function (raw, label) {
var r = { time: [label], energy: [label] };
raw.split("\n").forEach(function (item) {
if (item.length == 0)
return;
var d = item.split(/[ ]+/);
r.time.push(parseFloat(d[0]));
r.energy.push(parseFloat(d[1]));
});
return r;
};
var renderBenchmark = function (benchName, data) {
var t = document.querySelector('#bench-template');
var clone = document.importNode(t.content, true);
clone.querySelector('h1').innerHTML = benchName;
var div = clone.firstElementChild;
document.body.appendChild(clone);
generateChartFor(div, data);
};
var executeAndProcessRequestsFor = function (benchName, requests) {
Rx.Observable.merge(requests)
.reduce(function (acc, v) {
return {
time: acc.time.concat([v.time]),
energy: acc.energy.concat([v.energy]),
};
}, { time: [], energy: [] })
.subscribe(
renderBenchmark.bind(null, benchName),
function (err) {
console.log("Error processing " + benchName + ": " + err);
});
};
var benchmarkObservable = Rx.DOM.getJSON('benchmarks.json')
.flatMap(function (benchmarks) {
return Rx.Observable.fromArray(benchmarks);
})
.flatMap(function (benchmark) {
return Rx.DOM.getJSON(benchmark + '/files.json')
.map(function (fs) {
return { id: benchmark, files: fs};
});
})
.reduce (function (acc, v) {
acc[v.id] = v.files;
return acc;
}, {});
benchmarkObservable.subscribe(
function (benchmarks) {
for (var benchName in benchmarks) {
var os = [];
benchmarks[benchName].forEach(function (file) {
var url = benchName + '/' + file;
var o = Rx.DOM.get(url)
.map(function (data) {
return parseData(data.response, file.split(".")[1]);
});
os.push(o);
});
executeAndProcessRequestsFor(benchName, os);
}
},
function (err) {
console.error("Error loading data: " + err)
}
);
</script>
</body>
</html>