|
1 |
| -@doc_str """ |
| 1 | +doc""" |
2 | 2 | output(result, nv, ne)
|
3 | 3 |
|
4 | 4 | Print Graph500 Benchmark statistics(http://graph500.org/?page_id=12#sec-9_3)
|
5 | 5 | """
|
6 | 6 | function output(result::Graph500Results,nv::Integer,ne::Integer)
|
7 |
| - print_with_color(:green, "\n", "Benchmark Info", "\n") |
8 |
| - println("Scale : ", result.scale) |
9 |
| - println("Number of vertices : ", nv) |
10 |
| - println("Number of Edges : ", ne) |
11 |
| - println("Number of Bfs : ", result.nbfs, "\n") |
12 |
| - |
13 |
| - # kernel 1 Construction time |
14 |
| - print_with_color(:green, "\n", "Graph construction time", "\n") |
15 |
| - println("Graph Construction Time : ", result.kernel_1_time, "\n") |
16 |
| - |
17 |
| - # bfs time statistics |
18 |
| - bfs_time_stats = summarystats(result.kernel_2_time) |
19 |
| - print_with_color(:green, "\n", "BFS time statistics", "\n") |
20 |
| - println("BFS min time : ", bfs_time_stats.min) |
21 |
| - println("BFS first quartile time : ", bfs_time_stats.q25) |
22 |
| - println("BFS median time : ", bfs_time_stats.median) |
23 |
| - println("BFS third quartile time : ", bfs_time_stats.q75) |
24 |
| - println("BFS max time : ", bfs_time_stats.max) |
25 |
| - println("BFS mean time : ", bfs_time_stats.mean) |
26 |
| - println("BFS standard deviation time : ", std(result.kernel_2_time), "\n") |
27 |
| - |
28 |
| - # bfs statistics based on number of edges |
29 |
| - bfs_edgetraversed_stats = summarystats(result.kernel_2_nedge) |
30 |
| - print_with_color(:green, "\n", "Edges traversed per BFS statistics", "\n") |
31 |
| - println("BFS min nedge : ", bfs_edgetraversed_stats.min) |
32 |
| - println("BFS first quartile nedge : ", bfs_edgetraversed_stats.q25) |
33 |
| - println("BFS median nedge : ", bfs_edgetraversed_stats.median) |
34 |
| - println("BFS third quartile nedge : ", bfs_edgetraversed_stats.q75) |
35 |
| - println("BFS max nedge : ", bfs_edgetraversed_stats.max) |
36 |
| - println("BFS mean nedge : ", bfs_edgetraversed_stats.mean) |
37 |
| - println("BFS standard deviation nedge : ", std(result.kernel_2_nedge), "\n") |
38 |
| - |
39 |
| - # statistics on traversed edges per second(teps) |
40 |
| - bfs_teps = result.kernel_2_nedge ./ result.kernel_2_time |
41 |
| - bfs_n = length(bfs_teps) |
42 |
| - teps_stats = summarystats(bfs_teps) |
43 |
| - print_with_color(:green, "\n", "Edges traversed per second statistics", "\n") |
44 |
| - println("BFS min TEPS : ", teps_stats.min) |
45 |
| - println("BFS first quartile TEPS : ", teps_stats.q25) |
46 |
| - println("BFS median TEPS : ", teps_stats.median) |
47 |
| - println("BFS third quartile TEPS : ", teps_stats.q75) |
48 |
| - println("BFS max TEPS : ", teps_stats.max) |
49 |
| - |
50 |
| - # harmomnic mean of teps |
51 |
| - k2tmp = 1.0 ./ bfs_teps |
52 |
| - k2tmp = k2tmp - (1/harmmean(bfs_teps)) |
53 |
| - harmonic_std = (sqrt(sum(k2tmp.^2)) / (bfs_n-1)) * harmmean(bfs_teps)^2 |
54 |
| - println("BFS harmonic mean TEPS : ", harmmean(bfs_teps)) |
55 |
| - println("BFS harmonic standard deviation TEPS : ", harmonic_std, "\n") |
56 |
| - end |
| 7 | + io = IOContext(stdout, :color=>true) |
| 8 | + printstyled(io, "\n", "Benchmark Info", "\n", color=:green) |
| 9 | + println("Scale : ", result.scale) |
| 10 | + println("Number of vertices : ", nv) |
| 11 | + println("Number of Edges : ", ne) |
| 12 | + println("Number of Bfs : ", result.nbfs, "\n") |
| 13 | + |
| 14 | + # kernel 1 Construction time |
| 15 | + printstyled(io, "\n", "Graph construction time", "\n", color=:green) |
| 16 | + println("Graph Construction Time : ", result.kernel_1_time, "\n") |
| 17 | + |
| 18 | + # bfs time statistics |
| 19 | + bfs_time_stats = summarystats(result.kernel_2_time) |
| 20 | + printstyled(io, "\n", "BFS time statistics", "\n", color=:green) |
| 21 | + println("BFS min time : ", bfs_time_stats.min) |
| 22 | + println("BFS first quartile time : ", bfs_time_stats.q25) |
| 23 | + println("BFS median time : ", bfs_time_stats.median) |
| 24 | + println("BFS third quartile time : ", bfs_time_stats.q75) |
| 25 | + println("BFS max time : ", bfs_time_stats.max) |
| 26 | + println("BFS mean time : ", bfs_time_stats.mean) |
| 27 | + println("BFS standard deviation time : ", std(result.kernel_2_time), "\n") |
| 28 | + |
| 29 | + # bfs statistics based on number of edges |
| 30 | + bfs_edgetraversed_stats = summarystats(result.kernel_2_nedge) |
| 31 | + printstyled(io, "\n", "Edges traversed per BFS statistics", "\n", color=:green) |
| 32 | + println("BFS min nedge : ", bfs_edgetraversed_stats.min) |
| 33 | + println("BFS first quartile nedge : ", bfs_edgetraversed_stats.q25) |
| 34 | + println("BFS median nedge : ", bfs_edgetraversed_stats.median) |
| 35 | + println("BFS third quartile nedge : ", bfs_edgetraversed_stats.q75) |
| 36 | + println("BFS max nedge : ", bfs_edgetraversed_stats.max) |
| 37 | + println("BFS mean nedge : ", bfs_edgetraversed_stats.mean) |
| 38 | + println("BFS standard deviation nedge : ", std(result.kernel_2_nedge), "\n") |
| 39 | + |
| 40 | + # statistics on traversed edges per second(teps) |
| 41 | + bfs_teps = result.kernel_2_nedge ./ result.kernel_2_time |
| 42 | + bfs_n = length(bfs_teps) |
| 43 | + teps_stats = summarystats(bfs_teps) |
| 44 | + printstyled(io, "\n", "Edges traversed per second statistics", "\n", color=:green) |
| 45 | + println("BFS min TEPS : ", teps_stats.min) |
| 46 | + println("BFS first quartile TEPS : ", teps_stats.q25) |
| 47 | + println("BFS median TEPS : ", teps_stats.median) |
| 48 | + println("BFS third quartile TEPS : ", teps_stats.q75) |
| 49 | + println("BFS max TEPS : ", teps_stats.max) |
| 50 | + |
| 51 | + # harmomnic mean of teps |
| 52 | + k2tmp = 1.0 ./ bfs_teps |
| 53 | + k2tmp = k2tmp .- (1/harmmean(bfs_teps)) |
| 54 | + harmonic_std = (sqrt(sum(k2tmp.^2)) / (bfs_n-1)) * harmmean(bfs_teps)^2 |
| 55 | + println("BFS harmonic mean TEPS : ", harmmean(bfs_teps)) |
| 56 | + println("BFS harmonic standard deviation TEPS : ", harmonic_std, "\n") |
| 57 | +end |
0 commit comments