|
3 | 3 | """ |
4 | 4 | Plot string scaling results stored in a given folder |
5 | 5 | """ |
| 6 | +import os |
6 | 7 | import json |
7 | 8 | import glob |
8 | 9 |
|
9 | 10 | import numpy as np |
10 | 11 | import matplotlib.pyplot as plt |
11 | 12 |
|
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 |
13 | 22 |
|
14 | 23 | R = 2 |
15 | 24 | if R == 2: |
|
51 | 60 |
|
52 | 61 | symbols = ["o", "^", "s", "p", "*"] |
53 | 62 | colors = plt.rcParams['axes.prop_cycle'].by_key()['color'] |
54 | | -ls = "--" if "64tpc" in folder else "-" |
| 63 | +ls = "--" if "128tpc" in folder else "-" |
55 | 64 |
|
56 | | -plt.figure("scaling"+"-nSpS"*useNSpS+f"-R{R}") |
| 65 | +plt.figure("scaling"+"-nSpS"*useNSpS+f"-R{R}-{folder}") |
57 | 66 | for scheme, sym, col in zip(results.keys(), symbols, colors): |
58 | 67 | res = np.array(results[scheme]).T |
59 | 68 | 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") |
61 | 70 | plt.legend() |
62 | 71 | plt.grid(True) |
63 | 72 | plt.xlabel("$N_{p}$") |
|
68 | 77 | plt.tight_layout() |
69 | 78 |
|
70 | 79 |
|
71 | | -plt.figure(f"PinT-speedup-R{R}") |
| 80 | +plt.figure(f"PinT-efficiency-R{R}-{folder}") |
72 | 81 | nProcSpace, tSDC = np.array(results["SDC"]).T |
| 82 | +spdIdeal = (1+(nSweeps-1)*nNodes)/(1+(nSweeps-1)) |
| 83 | +effIdeal = spdIdeal/nNodes |
73 | 84 | for scheme, sym, col in zip(schemes[2:], symbols, colors): |
74 | 85 | _, tSDCPinT = np.array(results[scheme]).T |
75 | 86 | 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) |
77 | 92 | plt.legend() |
78 | 93 | plt.grid(True) |
79 | | -plt.xlabel("$N_{p,S}$"), plt.ylabel("PinT Speedup") |
| 94 | +plt.xlabel("$N_{p,Space}$"), plt.ylabel("PinT-Efficiency") |
80 | 95 | plt.tight_layout() |
0 commit comments