Skip to content

Commit a416add

Browse files
committed
adjust to taurus
* taskset shall be done externaly * move to paper fitting
1 parent 2687a58 commit a416add

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

benchmark/compare.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import argparse
22
import pickle
33
import numpy
4-
from scipy.stats import linregress
54

65
parser = argparse.ArgumentParser(description='Compare two benchmarks.',
76
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
@@ -42,9 +41,9 @@
4241
if len(left_val)!=len(right_val):
4342
raise ValueError("Different Repetitons")
4443

45-
Y_left.append(left_val)
46-
Y_right.append(right_val)
47-
X.append(numpy.full([len(left_val)], it))
44+
Y_left.append(numpy.mean(left_val))
45+
Y_right.append(numpy.mean(right_val))
46+
X.append(numpy.full([1], it))
4847

4948
if args.s:
5049
print("\t\tInterations {}".format(it))
@@ -56,13 +55,13 @@
5655
Y_right = numpy.asarray(Y_right,dtype=float).flatten()
5756
X = numpy.asarray(X,dtype=float).flatten()
5857

59-
cost_left = linregress(X, Y_left)
60-
cost_right = linregress(X, Y_right)
58+
cost_left = numpy.polyfit(X, Y_left, 1)
59+
cost_right = numpy.polyfit(X, Y_right, 1)
6160

6261
if args.s:
6362
print("")
64-
print("\tSlope {:>7.4f} ns {:>7.4f} ns".format(cost_left.slope * 1e6, cost_right.slope* 1e6))
65-
print("\tIntercept {:>7.4f} s {:>7.4f} s".format(cost_left.intercept, cost_right.intercept))
63+
print("\tSlope {:>7.4f} us {:>7.4f} us".format(cost_left[0] * 1e6, cost_right[0] * 1e6))
64+
print("\tIntercept {:>7.4f} s {:>7.4f} s".format(cost_left[1], cost_right[1]))
6665

6766

6867

benchmark/compare_commits.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function benchmark_branch {
1212
head=`git rev-parse --short HEAD`
1313
pip install .
1414
cd $wd
15-
taskset -c 0 python benchmark.py -o result-$1-$head.pkl
15+
python benchmark.py -o result-$1-$head.pkl
1616
}
1717

1818
sleep 5

benchmark/run.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@
99
#SBATCH --comment=no_monitoring
1010
#SBATCH --job-name benchmark_python
1111

12-
module load Python/3.6.4-intel-2018a
13-
module unload intel
14-
module load intel
12+
module load Python/3.8.6-GCCcore-10.2.0
13+
module load Score-P/7.0-gompic-2020b
1514

16-
export PATH=/scratch/rschoene/scorep-6-inst/bin:$PATH
15+
env_dir=~/virtenv/p-3.8.6-GCCcore-10.2.0-scorep-7.0-gompic-2020b/
1716

18-
. ~/scorep_binding_python/test/bin/activate
17+
if [ ! -d $env_dir ]
18+
then
19+
echo "Please create virtual env under: $env_dir"
20+
exit -1
21+
fi
1922

20-
srun python benchmark.py
23+
source $env_dir/bin/activate
24+
25+
srun compare_commits.sh master faster

0 commit comments

Comments
 (0)