forked from chpc-tech-eval/scc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
format.pl
95 lines (82 loc) · 3.15 KB
/
format.pl
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
#! /usr/bin/perl
#
# Usage: hpccoutf.pl -a -f hpccoputf.txt To show all parameters
# hpccoutf.pl -w -f hpccoputf.txt To show web parameters
#
use strict;
#use diagnostics;
use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
our ( $opt_a, $opt_w, $opt_f, $value, $count, $key ) = 0;
getopts("awf:");
unless ( $opt_a || $opt_w && $opt_f ) {
print "\n";
print "Usage: $0 -a -f hpccoutf.txt For all parameters\n";
print " $0 -w -f hpccoutf.txt For web parameters\n";
exit;
}
$/ = undef;
open HPPCOUTF, $opt_f or die $!;
my $file = <HPPCOUTF>;
my %hpccoutf = $file =~ /^(\w+)=(\d.*)$/mg;
close HPPCOUTF;
my @walkorder = (
'HPL_Tflops', 'PTRANS_GBs',
'MPIRandomAccess_GUPs', 'MPIFFT_Gflops',
'StarSTREAM_Triad*CommWorldProcs', 'StarSTREAM_Triad',
'StarDGEMM_Gflops', 'RandomlyOrderedRingBandwidth_GBytes',
'RandomlyOrderedRingLatency_usec' );
my @walkunits = (
'Tera Flops per Second', 'Tera Bytes per Second',
'Giga Updates per Second', 'Tera Flops per Second',
'Tera Bytes per Second', 'Giga Bytes per Second',
'Giga Flops per Second', 'Giga Bytes per second',
'micro-seconds');
my %crosswalk = (
HPL_Tflops => 'G-HPL',
PTRANS_GBs => 'G-PTRANS',
MPIRandomAccess_GUPs => 'G-RandomAccess',
MPIFFT_Gflops => 'G-FFT',
'StarSTREAM_Triad*CommWorldProcs' => 'EP-STREAM Sys',
CommWorldProcs => 'MPI Processes',
StarSTREAM_Triad => 'EP-STREAM Triad',
StarDGEMM_Gflops => 'EP-DGEMM',
RandomlyOrderedRingBandwidth_GBytes => 'RandomRing Bandwidth',
RandomlyOrderedRingLatency_usec => 'RandomRing Latency'
);
if ( $opt_a ) { show_all(); }
if ( $opt_w ) { show_web(); }
### Show all parameters from hpcc output file
sub show_all {
foreach $key ( sort keys %hpccoutf ) {
print $key . ': ' . $hpccoutf{"$key"} . "\n";
}
}
### Show web parameters from hpcc output file
sub show_web {
print "\n";
foreach $key ( @walkorder ) {
$value = '';
if ( $key eq 'StarSTREAM_Triad*CommWorldProcs') {
$value = $hpccoutf{'StarSTREAM_Triad'} * $hpccoutf{'CommWorldProcs'} / 1000;
write;
} elsif ( $key eq 'PTRANS_GBs' or $key eq 'MPIFFT_Gflops' ) {
$value = $hpccoutf{$key} / 10000;
write;
} else {
$value = $hpccoutf{$key};
write;
}
$count++;
}
print '--------------------------------------------------------------------------------------------------'."\n";
}
format STDOUT_TOP =
--------------------------------------------------------------------------------------------------
HPCCOUTF NAME WEB NAME VALUE UNITS
--------------------------------------------------------------------------------------------------
.
format STDOUT =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<< @#######.#### @<<<<<<<<<<<<<<<<<<<<<<
$key, $crosswalk{$key}, $value, $walkunits[$count]
.