From af7bd4a5810a73c13dc1c18a11e72188147a2a2d Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Mon, 13 May 2019 17:14:08 +0200 Subject: [PATCH 1/4] 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"; From 9159f131d6278289215baabf2a618c9d6f3310b2 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Tue, 14 May 2019 07:27:50 +0200 Subject: [PATCH 2/4] Add optional argument for SMT configuration. --- bench.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bench.pl b/bench.pl index ed28d1c..69c91eb 100755 --- a/bench.pl +++ b/bench.pl @@ -7,10 +7,11 @@ my $CMD = $ARGV[0]; my @N = split /-/, $ARGV[1]; my $R = $ARGV[2]; my $MAX = 0; my $CORES = 0; my $BENCH = ''; +my $SMT = $ARGV[3] ? $ARGV[3] : 2; foreach my $numcores ( $N[0] ... $N[1] ) { foreach ( 1 ... $R ) { - foreach my $ln ( split /\n/, `likwid-pin -c E:S0:$numcores:1:2 $CMD` ){ + foreach my $ln ( split /\n/, `likwid-pin -c E:S0:$numcores:1:$SMT $CMD` ){ if ( $ln =~ /^([A-Za-z]+):[ ]+([0-9.]+) /) { if ( $MAX < $2 ){ $MAX = $2; $CORES = $numcores; $BENCH = $1; From 7fa46331a499922af2317e1b44ce93534b008ade Mon Sep 17 00:00:00 2001 From: moebiusband73 Date: Tue, 14 May 2019 07:35:46 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 72fc4c3..cf4f064 100644 --- a/README.md +++ b/README.md @@ -102,3 +102,16 @@ SDaxpy: 46822.63 23411.32 0.0281 0.0273 0.0325 ---------------------------------------------------------------------------- Solution Validates ``` + +A perl wrapper script (bench.pl) is also provided to scan certain range of thread counts and determine the absolute highest sustained main memory bandwidth. In order to use it `likwid-pin` has to be in your path. The script has three required and one optional command line arguments: +``` +$./bench.pl [] +``` +Example usage: +``` +$./bench.pl ./bwbench-GCC 2-8 6 +``` +The script will always use physical cores only, where two SMT threads is the default. For different SMT thread counts use the 4th command line argument. Example for a processor without SMT: +``` +$./bench.pl ./bwbench-GCC 14-24 10 1 +``` From 3a3aa561c61d51d5603a7dcde3890b57977b3067 Mon Sep 17 00:00:00 2001 From: moebiusband73 Date: Tue, 14 May 2019 07:36:35 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cf4f064..ad0e064 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ SDaxpy: 46822.63 23411.32 0.0281 0.0273 0.0325 Solution Validates ``` -A perl wrapper script (bench.pl) is also provided to scan certain range of thread counts and determine the absolute highest sustained main memory bandwidth. In order to use it `likwid-pin` has to be in your path. The script has three required and one optional command line arguments: +A perl wrapper script (bench.pl) is also provided to scan ranges of thread counts and determine the absolute highest sustained main memory bandwidth. In order to use it `likwid-pin` has to be in your path. The script has three required and one optional command line arguments: ``` $./bench.pl [] ```