Skip to content

Commit 6a0625f

Browse files
authored
1 Provide automated scripts for benchmarking and visualizing results (#2)
- Creation of a script for benchmarking GMGPolar with MUMPs. - Creation of python utitilies to extract LIKWID outputs and plot basic curves. - Added some additional documentation.
1 parent ad33dde commit 6a0625f

57 files changed

Lines changed: 518 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

batch.sh_paper

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,8 @@
1616
debug=0
1717
v1=1
1818
v2=1
19-
cycle=1
20-
compute_rho=0
21-
level=-1
2219
maxiter=300
23-
periodic=1
24-
theta_aniso=0
25-
discr=1
2620
nr_exp=4
27-
ntheta_exp=4
2821
res_norm=3
2922
R0=1e-6
3023
DirBC_Interior=0
@@ -80,28 +73,30 @@ done
8073
mkdir -p outputs
8174

8275
echo "prob alpha_coeff beta_coeff fac_ani extrapolation mod_pk"
83-
# Triangular-Shafranov
84-
for mod_pk in 2 1
76+
# 1) Triangular/Czarny 2) Shafranov
77+
for mod_pk in 2 1 # 2=Triangular/Czarny, 1=Shafranov
8578
do
8679
# Cartesian + beta 0 + ani 0
87-
prob=7
80+
prob=7 # Solution (23) of Bourne et al.
8881
echo $prob $alpha_coeff $beta_coeff $fac_ani $extrapolation $mod_pk
8982
for extrapolation in 1
9083
do
9184
for divideBy2 in 0 1 2 3 4 5 6 #iterate over the different grid sizes
9285
do
86+
# note that the divideBy2 option here is only used as a dummy for looping. Grids need to be stored beforehand and are loaded here.
9387
echo "./${build_dir}/gmgpolar_simulation -n "$nr_exp" -a "$fac_ani" --mod_pk "$mod_pk" --DirBC_Interior "$DirBC_Interior" --divideBy2 0 -r "$R0" --smoother "$smoother" --verbose 2 --debug "$debug" --extrapolation "$extrapolation" --optimized 1 --openmp "$openmp" --v1 "$v1" --v2 "$v2" -R "$R" --prob "$prob" --maxiter "$maxiter" --alpha_coeff "$alpha_coeff" --beta_coeff "$beta_coeff" --res_norm "$res_norm" --f_grid_r radii_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt --f_grid_theta angles_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt --rel_red_conv "$rel_red_conv" 1> outputs/job.out_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt 2> outputs/job.err_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt"
9488
./${build_dir}/gmgpolar_simulation -n $nr_exp -a $fac_ani --mod_pk $mod_pk --DirBC_Interior $DirBC_Interior --divideBy2 0 -r $R0 --smoother $smoother --verbose 2 --debug $debug --extrapolation $extrapolation --optimized 1 --openmp $openmp --v1 $v1 --v2 $v2 -R $R --prob $prob --maxiter $maxiter --alpha_coeff $alpha_coeff --beta_coeff $beta_coeff --res_norm $res_norm --f_grid_r "radii_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt" --f_grid_theta "angles_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt" --rel_red_conv $rel_red_conv 1> "outputs/job.out_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt" 2> "outputs/job.err_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt"
9589
done
9690
done
9791

9892
# Polar + beta 0-1 + ani 0-1
99-
prob=6
93+
prob=6 # Solution (22) of Bourne et al.
10094
echo $prob $alpha_coeff $beta_coeff $fac_ani $extrapolation $mod_pk
10195
for extrapolation in 1
10296
do
10397
for divideBy2 in 0 1 2 3 4 5 6 #iterate over the different grid sizes
10498
do
99+
# note that the divideBy2 option here is only used as a dummy for looping. Grids need to be stored beforehand and are loaded here.
105100
echo "./${build_dir}/gmgpolar_simulation -n "$nr_exp" -a "$fac_ani" --mod_pk "$mod_pk" --DirBC_Interior "$DirBC_Interior" --divideBy2 0 -r "$R0" --smoother "$smoother" --verbose 2 --debug "$debug" --extrapolation "$extrapolation" --optimized 1 --openmp "$openmp" --v1 "$v1" --v2 "$v2" -R "$R" --prob "$prob" --maxiter "$maxiter" --alpha_coeff "$alpha_coeff" --beta_coeff "$beta_coeff" --res_norm "$res_norm" --f_grid_r radii_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt --f_grid_theta angles_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt --rel_red_conv "$rel_red_conv" 1> outputs/job.out_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt 2> outputs/job.err_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt"
106101
./${build_dir}/gmgpolar_simulation -n $nr_exp -a $fac_ani --mod_pk $mod_pk --DirBC_Interior $DirBC_Interior --divideBy2 0 -r $R0 --smoother $smoother --verbose 2 --debug $debug --extrapolation $extrapolation --optimized 1 --openmp $openmp --v1 $v1 --v2 $v2 -R $R --prob $prob --maxiter $maxiter --alpha_coeff $alpha_coeff --beta_coeff $beta_coeff --res_norm $res_norm --f_grid_r "radii_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt" --f_grid_theta "angles_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt" --rel_red_conv $rel_red_conv 1> "outputs/job.out_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt" 2> "outputs/job.err_"$fac_ani"_"$mod_pk"_"$prob"_"$beta_coeff"_"$extrapolation"_"$divideBy2"_"$rel_red_conv".txt"
107102
done

include/constants.h

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,14 @@ enum stencil
350350
//const double PI = 3.141592653589793238463;
351351
const double PI = M_PI;
352352

353+
// See Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249
354+
// used as Param::mod_pk ("modified polar coordinates") in GMGPolar
353355
enum geometry_type
354356
{
355-
CIRCULAR = 0,
356-
SHAFRANOV = 1,
357-
TRIANGULAR = 2,
358-
CULHAM = 3
357+
CIRCULAR = 0, // simple circular domain
358+
SHAFRANOV = 1, // Fig. 6a
359+
TRIANGULAR = 2, // Fig. 6b (also denoted Czarny)
360+
CULHAM = 3 // Fig. 18
359361
};
360362

361363
enum alpha_val
@@ -366,12 +368,15 @@ enum alpha_val
366368
POISSON = 3,
367369
};
368370

371+
// Defines the manufactured solution to compare the computed error against.
372+
// see Kuehn et al. https://doi.org/10.1007/s10915-022-01802-1
373+
// or Bourne et al. https://doi.org/10.1016/j.jcp.2023.112249
369374
enum problem_type
370375
{
371376
FLAT = 1,
372377
REFINED_RADIUS = 4,
373-
CARTESIAN_R2 = 5,
374-
POLAR_R6 = 6,
375-
CARTESIAN_R6 = 7,
378+
CARTESIAN_R2 = 5, //
379+
POLAR_R6 = 6, // Bourne et al., Eq. (22)
380+
CARTESIAN_R6 = 7, // Bourne et al., Eq. (23)
376381
};
377382
#endif // CONSTANTS_HXX

performance/run_gmgpolar.sh

Lines changed: 106 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,133 @@
11
#!/bin/bash
2+
#SBATCH --job-name=gmgpolar-setup
3+
#SBATCH --output=slurm-%A-setup.out
4+
#SBATCH --error=slurm-%A-setup.err
5+
#SBATCH -N 1
6+
#SBATCH -n 1
7+
#SBATCH -c 1
8+
#SBATCH -t 5
29

310
#fixed variables
11+
# If Origin is chosen, the node can be set as coarse or fine. Default: Coarse.
412
origin_NOT_coarse=0 # origin_NOT_coarse
13+
# Choose anisotropy in angle-direction. Default: Off.
514
theta_aniso=0 # theta_aniso
15+
# Smoother 3 is our default, 13 is used for some testing, should be not used
16+
# for production. -> TODO: Rename smoother names
17+
smoother=3 # smoother (3,13)
618

7-
# changing variables ?!
8-
prob=5 # prob
9-
R=1.3 # R
10-
kappa_eps=0 # k
11-
delta_e=0 # d
12-
discr=3 # discr
13-
fac_ani=3 # a
14-
nr_exp=4 # n
19+
# default variables
20+
# If origin is not a particular node of the mesh, Dirichlet boundary conditions
21+
# can be implemented on the most inner circle
22+
DirBC_Interior=1 # DirBC_Interior (0/1)
23+
# Generalized radius of most inner circle. Defines if origin will be a particular node.
24+
R0=1e-8 # r (1e-8/1e-5/1e-2)
25+
# Generalized radius of maximum outer circle.
26+
R=1.3 # R
27+
# Anisotropy in radial direction.
28+
fac_ani=3 # a
29+
# TODO: which nr_exp and divideby2 do we want to consider?
30+
nr_exp=4 # n
1531

1632
#changing variables
17-
mod_pk=0 # mod_pk (0/1)
18-
R0=0.1 # r (1e-8/1e-5/1e-2)
19-
DirBC_Interior=0 # DirBC_Interior (0/1)
20-
divideBy2=0 # divideBy2 (3/4/5/6)
21-
smoother=3 # smoother (3,13)
22-
extrapolation=0 # E
33+
mod_pk=1 # mod_pk=1: Shafranov geometry
34+
prob=7 # Prob=7: Simulate solution (23) of Bourne et al.
35+
# TODO: which alpha and beta to simulate? Alpha aligned with anisotropy?
36+
alpha_coeff=2
37+
beta_coeff=1
38+
39+
# set to on
40+
extrapolation=1 # E
41+
42+
debug=0
43+
v1=1
44+
v2=1
45+
maxiter=300
46+
res_norm=3
47+
rel_red_conv=1e-11
48+
49+
nodes=1
50+
ranks=1 # number of MPI Ranks
51+
cores=128 # set OpenMP Num Threads to maximum number of cores requested
52+
53+
####################################
54+
## create grids ##
55+
####################################
56+
create_grid=0
57+
if [ $create_grid ]
58+
then
59+
cd ..
60+
mkdir -p angles_files/Rmax"$R"/aniso"$fac_ani"/
61+
mkdir -p radii_files/Rmax"$R"/aniso"$fac_ani"/
62+
# Costly function as setup as expensive and sequential. Only run once.
63+
for divideBy2 in 0 1 2 3 4 5 6 7 8 # create different grid sizes
64+
do
65+
## ATTENTION / REMARK:
66+
## Please note that these calls will abort/segfault as creation of grids and computation in one step
67+
## is not yet supported by GMGPolar. We will make this functionality available in a future commit.
68+
## Please ignore abort/segfault for the calls in this loop.
69+
# mod_pk has no effect on the creation of grids as the set of (r,theta) is
70+
# the same for all geometries, only the mapping F(r,theta) -> (x,y) changes.
71+
./build/gmgpolar_simulation -n $nr_exp -a $fac_ani --mod_pk 0 --DirBC_Interior $DirBC_Interior --divideBy2 $divideBy2 -r $R0 --smoother $smoother --verbose 2 --debug $debug --extrapolation $extrapolation --optimized 1 $ --v1 $v1 --v2 $v2 -R $R --prob $prob --maxiter $maxiter --alpha_coeff $alpha_coeff --beta_coeff $beta_coeff --res_norm $res_norm --write_radii_angles 1 --f_grid_r "radii_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt" --f_grid_theta "angles_files/Rmax"$R"/aniso"$fac_ani"/divide"$divideBy2".txt"
72+
done
73+
fi
2374

2475
echo "#!/bin/bash" > run_gmgpolar_sbatch.sh
2576
# create a short name for your job
2677
echo "#SBATCH --job-name=gmgpolar" >> run_gmgpolar_sbatch.sh
2778
# stdout file %A=job id
28-
echo "#SBATCH --output=slurm-%A-p$prob-fa$fac_ani-r$nr_exp-mpk$mod_pk-s$smoother-e$extrapolation.out" >> run_gmgpolar_sbatch.sh
79+
echo "#SBATCH --output=slurm-%A-p$prob-r$nr_exp-mpk$mod_pk-s$smoother-e$extrapolation--N$nodes-R$ranks-maxC$cores.out" >> run_gmgpolar_sbatch.sh
2980
# stderr file
30-
echo "#SBATCH --error=slurm-%A-p$prob-fa$fac_ani-r$nr_exp-mpk$mod_pk-s$smoother-e$extrapolation.err" >> run_gmgpolar_sbatch.sh
81+
echo "#SBATCH --error=slurm-%A-p$prob-r$nr_exp-mpk$mod_pk-s$smoother-e$extrapolation--N$nodes-R$ranks-maxC$cores.err" >> run_gmgpolar_sbatch.sh
3182

32-
echo "#SBATCH -N 1" >> run_gmgpolar_sbatch.sh
33-
echo "#SBATCH -n 1" >> run_gmgpolar_sbatch.sh
34-
echo "#SBATCH -c 14" >> run_gmgpolar_sbatch.sh
35-
echo "#SBATCH -t 6000" >> run_gmgpolar_sbatch.sh
83+
echo "#SBATCH -N $nodes" >> run_gmgpolar_sbatch.sh
84+
echo "#SBATCH -n $ranks" >> run_gmgpolar_sbatch.sh
85+
echo "#SBATCH -c $cores" >> run_gmgpolar_sbatch.sh
86+
# fix to one thread per core
87+
echo "#SBATCH --threads-per-core=1" >> run_gmgpolar_sbatch.sh
88+
# fix CPU frequency to 1.8 Mhz
89+
echo "#SBATCH --cpu-freq=1800000" >> run_gmgpolar_sbatch.sh
90+
echo "#SBATCH -t 600" >> run_gmgpolar_sbatch.sh
3691
echo "#SBATCH --exclusive" >> run_gmgpolar_sbatch.sh
3792

3893
# remove potentially loaded and conflicting modules
3994
echo "module purge" >> run_gmgpolar_sbatch.sh
4095

41-
# gcc10
42-
echo "module load PrgEnv/gcc10-openmpi" >> run_gmgpolar_sbatch.sh
96+
# CARO
97+
#echo "module load rev/23.05" >> run_gmgpolar_sbatch.sh
98+
# spack install mumps@XXX+metis~mpi
99+
echo "module load likwid/5.2.2" >> run_gmgpolar_sbatch.sh
100+
# Local machine
101+
# echo "module load PrgEnv/gcc10-openmpi" >> run_gmgpolar_sbatch.sh
102+
103+
# echo "cd .." >> run_gmgpolar_sbatch.sh
104+
# echo "make -j16" >> run_gmgpolar_sbatch.sh
105+
106+
# to be defined for use case (3/4/5/6)
107+
# Attention: divideBy is used as a dummy variable to access folders as grids are read in
108+
echo "let divideBy2=4" >> run_gmgpolar_sbatch.sh
43109

44-
echo "cd .." >> run_gmgpolar_sbatch.sh
45-
echo "make -j16" >> run_gmgpolar_sbatch.sh
110+
####################################
111+
## solve system ##
112+
####################################
46113

47-
# FLOPS-DP counter
48-
echo "for m in {0..1}; do" >> run_gmgpolar_sbatch.sh
49-
echo "likwid-perfctr -C 0-$m -g FLOPS_DP ./build_gnu/main --matrix_free 1 -n $nr_exp -a $fac_ani --mod_pk $mod_pk --DirBC_Interior $DirBC_Interior --divideBy2 $divideBy2 -r $R0 --smoother $smoother -E $extrapolation" >> run_gmgpolar_sbatch.sh
114+
# reduce cores as cores count from 0
115+
max_threads=$((cores))
116+
echo "let m=1" >> run_gmgpolar_sbatch.sh
117+
# FLOPS-DP counter from 1 to cores many threads
118+
echo "while [ \$m -le $max_threads ]; do" >> run_gmgpolar_sbatch.sh
119+
echo "let mminus1=m-1" >> run_gmgpolar_sbatch.sh
120+
echo "srun --cpus-per-task=\$m likwid-perfctr -f -C 0-\$mminus1 -g FLOPS_DP ./build/gmgpolar_simulation --openmp \$m --matrix_free 1 -n $nr_exp -a $fac_ani --mod_pk $mod_pk --DirBC_Interior $DirBC_Interior --divideBy2 0 -r $R0 --smoother $smoother -E $extrapolation --verbose 2 --debug $debug --optimized 1 --v1 $v1 --v2 $v2 -R $R --prob $prob --maxiter $maxiter --alpha_coeff $alpha_coeff --beta_coeff $beta_coeff --res_norm $res_norm --f_grid_r "radii_files/Rmax"$R"/aniso"$fac_ani"/divide"\$divideBy2".txt" --f_grid_theta "angles_files/Rmax"$R"/aniso"$fac_ani"/divide"\$divideBy2".txt" --rel_red_conv $rel_red_conv" >> run_gmgpolar_sbatch.sh
121+
echo "let m=m*2" >> run_gmgpolar_sbatch.sh
50122
echo "done;" >> run_gmgpolar_sbatch.sh
51123

52-
# memory (saturation) benchmarks
53-
echo "for m in {0..1}; do" >> run_gmgpolar_sbatch.sh
54-
echo "likwid-perfctr -C 0-$m -g CACHES ./build_gnu/main -n $nr_exp -a $fac_ani --mod_pk $mod_pk --DirBC_Interior $DirBC_Interior --divideBy2 $divideBy2 -r $R0 --smoother $smoother -E $extrapol" >> run_gmgpolar_sbatch.sh
124+
# # Memory (saturation) benchmarks
125+
echo "let m=1" >> run_gmgpolar_sbatch.sh
126+
echo "while [ \$m -le $max_threads ]; do" >> run_gmgpolar_sbatch.sh
127+
echo "let mminus1=m-1" >> run_gmgpolar_sbatch.sh
128+
echo "srun --cpus-per-task=\$m likwid-perfctr -f -C 0-\$mminus1 -g CACHE ./build/gmgpolar_simulation --openmp \$m --matrix_free 1 -n $nr_exp -a $fac_ani --mod_pk $mod_pk --DirBC_Interior $DirBC_Interior --divideBy2 0 -r $R0 --smoother $smoother -E $extrapolation --verbose 2 --debug $debug --optimized 1 --v1 $v1 --v2 $v2 -R $R --prob $prob --maxiter $maxiter --alpha_coeff $alpha_coeff --beta_coeff $beta_coeff --res_norm $res_norm --f_grid_r "radii_files/Rmax"$R"/aniso"$fac_ani"/divide"\$divideBy2".txt" --f_grid_theta "angles_files/Rmax"$R"/aniso"$fac_ani"/divide"\$divideBy2".txt" --rel_red_conv $rel_red_conv" >> run_gmgpolar_sbatch.sh
129+
echo "let m=m*2" >> run_gmgpolar_sbatch.sh
55130
echo "done;" >> run_gmgpolar_sbatch.sh
56131

57132
#submit the job
58-
sbatch run_gmgpolar_sbatch.sh
133+
sbatch run_gmgpolar_sbatch.sh
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import pandas as pd
2+
import numpy as np
3+
import sys
4+
# Use backend to not plot on UI
5+
# import matplotlib
6+
# matplotlib.use('Agg')
7+
import matplotlib.pyplot as plt
8+
from os.path import join, exists, dirname
9+
from os import makedirs
10+
11+
### Plots scaling of FLOPS and Caches (saturation) scaling from 0 to n Cores
12+
### as read from data frame
13+
14+
colors = [
15+
[1.00, 0.49, 0.06],
16+
[0.17, 0.63, 0.18],
17+
[0.83, 0.15, 0.16],
18+
[0.13, 0.47, 0.69],
19+
[0.58, 0.40, 0.74],
20+
[0.53, 0.35, 0.27],
21+
[0.92, 0.46, 0.77],
22+
[0.50, 0.50, 0.50],
23+
[0.66, 0.85, 0.06],
24+
[0.06, 0.85, 0.85],
25+
[0.85, 0.15, 0.85],
26+
[0.75, 0.75, 0.75]];
27+
28+
def plot_perf_per_core(path_out, fname, df, benchname, saturation_limit=0, colors=colors):
29+
fontsize = 16
30+
31+
fig = plt.figure(figsize=(10, 10))
32+
ax = fig.add_subplot()
33+
plt.plot(df['Cores'], df[benchname[0]])
34+
35+
if benchname[0] == 'CACHES':
36+
plt.plot(df['Cores'], saturation_limit * np.ones(len(df['Cores'])), linestyle='dotted', linewidth=3, color=[0, 0, 0])
37+
ax.text(1, saturation_limit+3, 'Memory bandwith (AXPY) (' + str(saturation_limit) + ' GBytes/s)', fontsize=14)
38+
ax.set_ylim(0, 90)
39+
40+
41+
ax.set_title(benchname[1][0], fontsize=fontsize+6)
42+
ax.set_ylabel(benchname[1][0], fontsize=fontsize)
43+
44+
ax.set_xlabel('Number of cores used', fontsize=fontsize)
45+
46+
47+
path_out = join(path_out, 'figures')
48+
if not exists(path_out):
49+
makedirs(path_out)
50+
plt.savefig(join(path_out, fname + '_' + benchname[0].lower()), bbox_inches='tight')
51+
plt.close()
52+
53+
54+
def main():
55+
56+
problem = 5
57+
nr_exp = 4
58+
mod_pk = 1
59+
smoother = 3
60+
extrapolation = 1
61+
62+
nodes = 1
63+
ranks = 1
64+
maxCores = 14
65+
66+
## saturation_limit is node specific and needs to be adapted.
67+
saturation_limit = 80
68+
69+
fname = 'p' + str(problem) + '-r' + str(nr_exp) + '-mpk' + str(mod_pk) + '-s' + str(
70+
smoother) + '-e' + str(extrapolation) + '--N' + str(nodes) + '-R' + str(ranks) + '-maxC' + str(maxCores)
71+
path_to_files_rel = '' # relative to plot script
72+
path_to_files = join(dirname(__file__), join(path_to_files_rel))
73+
74+
df = pd.read_csv(
75+
join(path_to_files, fname + '_benchmarks.csv'),
76+
dtype={'Problem': int, 'rExp': int, 'ModPK': int,
77+
'Extrapolation': int, 'Nodes': int, 'Ranks': int,
78+
'Cores': int, 'its': int})
79+
80+
# Likwid benchmark columns, more benchmarks are in timings.
81+
likwid_benchmarks = {'FLOPS_DP': ['Flop performance in Multi-Threading', 'Flops (GFlops/s)'], 'CACHES': [
82+
'Memory bandwidth saturation', 'Memory bandwidth (GBytes/s)']} # benchmark : [plot title, plot y-label]
83+
timing_benchmarks = {'Total_execution_time' : ['Total execution time in Multi-Threading', 'Execution time']}
84+
# Problem setting columns
85+
setting_cols = ['Problem', 'rExp', 'ModPK', 'Extrapolation', 'Nodes', 'Ranks']
86+
87+
# check content
88+
for bench in likwid_benchmarks.items():
89+
bench_rows = np.where(df[bench[0]].isnull()!=True)[0]
90+
if len(bench_rows) > 0:
91+
df_subframe = df.iloc[bench_rows].copy()
92+
93+
# Check that the different number of threads/cores where only conducted
94+
# on one particular setting of the above columns
95+
if np.max(df_subframe.loc[:,setting_cols].nunique()) > 1:
96+
sys.exit('Error in input data, more than one setting found.')
97+
98+
# TODO or not TODO: If the same run was done multiple times with different LIKWID benchmarks
99+
# it is not clear which line to take.
100+
# This could be extended to take the weighted sum or minimum of all corresponding lines.
101+
# However, these timings should be identical or in the same region...
102+
# Nonetheless, there could be a nicer table format to store the results ;-)
103+
cores_used = df_subframe['Cores'].unique()
104+
if len(cores_used) != len(df_subframe['Cores']):
105+
sys.exit('Error: Multiple times computed with the same number of threads.')
106+
107+
plot_perf_per_core(path_to_files, fname, df_subframe, bench, saturation_limit=saturation_limit)
108+
109+
# Plot particular timings from table for first benchmark. Timings should be similar for FLOPS_DP and CACHES.
110+
if bench[0] == list(likwid_benchmarks.keys())[0]:
111+
for timing_benchmark in timing_benchmarks.items():
112+
plot_perf_per_core(path_to_files, fname, df_subframe, timing_benchmark)
113+
114+
115+
116+
if __name__ == '__main__':
117+
main()
118+

0 commit comments

Comments
 (0)