Skip to content

Commit 4cb6196

Browse files
committed
TL: minor improvements on plotScaling script
1 parent aef51a9 commit 4cb6196

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

pySDC/playgrounds/dedalus/scripts/plotScaling.py

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33
"""
44
Plot string scaling results stored in a given folder
55
"""
6+
import os
67
import json
78
import glob
89

910
import numpy as np
1011
import matplotlib.pyplot as plt
1112

12-
folder = "_benchJureca"
13+
folder = (
14+
"_benchJureca"
15+
# "_benchJusuf_64tpc"
16+
# "_benchJusuf"
17+
)
18+
assert os.path.isdir(folder), f"{folder} is not a folder"
19+
20+
nNodes = 4
21+
nSweeps = 4
1322

1423
R = 2
1524
if R == 2:
@@ -51,13 +60,13 @@
5160

5261
symbols = ["o", "^", "s", "p", "*"]
5362
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
54-
ls = "--" if "64tpc" in folder else "-"
63+
ls = "--" if "128tpc" in folder else "-"
5564

56-
plt.figure("scaling"+"-nSpS"*useNSpS+f"-R{R}")
65+
plt.figure("scaling"+"-nSpS"*useNSpS+f"-R{R}-{folder}")
5766
for scheme, sym, col in zip(results.keys(), symbols, colors):
5867
res = np.array(results[scheme]).T
5968
plt.loglog(*res, sym+ls, label=scheme, c=col)
60-
# plt.loglog(res[0], np.prod(res[:, 0])/res[0], "--", c="gray")
69+
plt.loglog(res[0], np.prod(res[:, 0])/res[0], "--", c="gray")
6170
plt.legend()
6271
plt.grid(True)
6372
plt.xlabel("$N_{p}$")
@@ -68,13 +77,19 @@
6877
plt.tight_layout()
6978

7079

71-
plt.figure(f"PinT-speedup-R{R}")
80+
plt.figure(f"PinT-efficiency-R{R}-{folder}")
7281
nProcSpace, tSDC = np.array(results["SDC"]).T
82+
spdIdeal = (1+(nSweeps-1)*nNodes)/(1+(nSweeps-1))
83+
effIdeal = spdIdeal/nNodes
7384
for scheme, sym, col in zip(schemes[2:], symbols, colors):
7485
_, tSDCPinT = np.array(results[scheme]).T
7586
speedup = tSDC[:len(tSDCPinT)]/tSDCPinT
76-
plt.semilogx(nProcSpace[:len(tSDCPinT)], speedup, sym+ls, c=col, label=scheme)
87+
efficiency = speedup/nNodes
88+
nPS = nProcSpace[:len(tSDCPinT)]
89+
plt.semilogx(nPS, efficiency, sym+ls, c=col, label=scheme)
90+
plt.semilogx(nPS, 0*nPS+effIdeal, "--", c="gray")
91+
plt.ylim(0, 1)
7792
plt.legend()
7893
plt.grid(True)
79-
plt.xlabel("$N_{p,S}$"), plt.ylabel("PinT Speedup")
94+
plt.xlabel("$N_{p,Space}$"), plt.ylabel("PinT-Efficiency")
8095
plt.tight_layout()

0 commit comments

Comments
 (0)