From af7bd4a5810a73c13dc1c18a11e72188147a2a2d Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Mon, 13 May 2019 17:14:08 +0200 Subject: [PATCH] Add wrapper Skript to determine overall best sustained bandwidth --- bench.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bench.pl diff --git a/bench.pl b/bench.pl new file mode 100755 index 0000000..ed28d1c --- /dev/null +++ b/bench.pl @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use utf8; + +my $CMD = $ARGV[0]; +my @N = split /-/, $ARGV[1]; +my $R = $ARGV[2]; +my $MAX = 0; my $CORES = 0; my $BENCH = ''; + +foreach my $numcores ( $N[0] ... $N[1] ) { + foreach ( 1 ... $R ) { + foreach my $ln ( split /\n/, `likwid-pin -c E:S0:$numcores:1:2 $CMD` ){ + if ( $ln =~ /^([A-Za-z]+):[ ]+([0-9.]+) /) { + if ( $MAX < $2 ){ + $MAX = $2; $CORES = $numcores; $BENCH = $1; + } + } + } + } +} +print "$BENCH was best using $CORES threads: $MAX\n";