Skip to content

Commit

Permalink
Add script for extracting scaling results.
Browse files Browse the repository at this point in the history
  • Loading branch information
moebiusband73 committed Dec 10, 2020
1 parent 0c22557 commit dce72b4
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions util/extractResults.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env perl
# =======================================================================================
#
# Author: Jan Eitzinger (je), [email protected]
# Copyright (c) 2020 RRZE, University Erlangen-Nuremberg
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# =======================================================================================
use strict;
use warnings;
use utf8;

my $DIR = $ARGV[0];
my %RES;

my @testcases = ('Init', 'Sum', 'Copy', 'Update', 'Triad', 'Daxpy', 'STriad', 'SDaxpy');

while( defined( my $file = glob($DIR . '/*' ) ) ) {

my $nt = 1;
open(my $fh, "<","$file");
if ($file =~ /.*-([0-9]+)\.txt/) {
$nt = $1;
}
$RES{$nt} = {};

while ( <$fh> ) {
my $cnt = split(/[ ]+/, $_);

if ( $cnt == 6 ) {
my @fields = split(/[ ]+/, $_);

if ( $fields[1] =~ /[0-9]+/ ) {
$fields[0] =~ s/://;
$RES{$nt}->{$fields[0]} = $fields[1];
}
}

}

close $fh or die "can't close file $!";
}

printf "#nt";
foreach my $test ( @testcases ) {
printf "\t%s", $test;
}
printf "\n";

foreach my $key (sort {$a <=> $b} keys %RES) {
printf "%d", $key;

foreach my $test ( @testcases ) {
printf "\t%.0f", $RES{$key}->{$test};
}
printf "\n";
}

0 comments on commit dce72b4

Please sign in to comment.