Skip to content

Commit ceeb616

Browse files
committed
TL: script update
1 parent 73c4be5 commit ceeb616

File tree

3 files changed

+62
-11
lines changed

3 files changed

+62
-11
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
"""
4+
Investigate the load of each compute node
5+
"""
6+
import pandas as pd
7+
8+
decompFile = "_decomp_N32.txt"
9+
10+
nodes = {}
11+
12+
with open(decompFile, "r") as f:
13+
lines = f.readlines()
14+
15+
lines = [l.strip() for l in lines[4:]]
16+
17+
nProcs = len(lines) // 5
18+
for i in range(nProcs):
19+
pos = 5*i
20+
ranks = lines[pos].split()[0]
21+
gR, sR, tR = ranks.split("-")
22+
cpu, nodeName = lines[pos+1][3:].split(" on ")
23+
cpu = cpu.replace(" ", "").replace("}", "").replace("{", "")
24+
25+
try:
26+
nodes[nodeName][cpu] = (gR, sR, tR)
27+
except:
28+
nodes[nodeName] = {cpu: (gR, sR, tR)}
29+
30+
31+
load = {}
32+
for name in nodes:
33+
cpus = nodes[name]
34+
nCPUs = len(cpus.keys())
35+
36+
tGroups = set(g[-1] for g in cpus.values())
37+
sGroups = set(g[-2] for g in cpus.values())
38+
39+
load[name] = dict(
40+
nCPUs=nCPUs,
41+
nTGroups=len(tGroups), nSGroups=len(sGroups),
42+
tGroups=tGroups, sGroups=sGroups,
43+
)
44+
45+
load = pd.DataFrame(load)
46+
print(load.iloc[:3])

pySDC/playgrounds/dedalus/scripts/collectInfos.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,37 @@
66
import argparse
77

88
parser = argparse.ArgumentParser(
9-
description='Collect simulation infos from simulation repositories',
9+
description='Collect info files from simulation repositories',
1010
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1111

1212
parser.add_argument(
1313
"prefix", help="prefix of the simulation directories (is removed from the collected file names)")
1414
parser.add_argument(
1515
"--outFolder", help="name of the output folder (default : prefix used)",
1616
default=None)
17+
parser.add_argument(
18+
"--fileName", help="name of the collected file",
19+
default="infos.json")
1720

1821
args = parser.parse_args()
1922

2023
prefix = args.prefix
2124
outFolder = prefix if args.outFolder is None else args.outFolder
25+
fileName = parser.fileName
2226

23-
print(f"Collecting {prefix}*/infos.json into {outFolder}")
27+
print(f"Collecting {prefix}*/{fileName} into {outFolder}")
2428
os.makedirs(outFolder, exist_ok=True)
2529

2630
folders = glob.glob(args.prefix+"*")
2731
for folder in folders:
28-
src = f"{folder}/infos.json"
32+
src = f"{folder}/{fileName}"
2933
if not os.path.isfile(src):
30-
print(f" -- {folder} does not contain infos.json, ignoring ...")
34+
print(f" -- {folder} does not contain {fileName}, ignoring ...")
3135
continue
3236

33-
dst = f"{outFolder}/{folder[len(prefix):]}.json"
37+
ext = fileName.split(".")[-1]
38+
dst = f"{outFolder}/{folder[len(prefix):]}.{ext}"
3439
print(f" -- copying {src} into {dst}")
3540
shutil.copy(src, dst)
3641

37-
print(" -- all done !")
42+
print(" -- all done !")

pySDC/playgrounds/dedalus/scripts/plotScaling.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
folder = "_benchJusuf"
1313

14-
schemes = ["RK443", "SDC", "SDC-MPI", "SDC-MPI2"]
14+
schemes = ["RK443", "SDC", "SDC-MPI", "SDC-MPI2", "SDC-MPI2-GT"]
1515
R = 2
1616

1717
useNSpS = False
@@ -20,6 +20,7 @@
2020
"SDC": 17,
2121
"SDC-MPI": 17,
2222
"SDC-MPI2": 17,
23+
"SDC-MPI2-GT": 17,
2324
}
2425

2526
results = {}
@@ -45,7 +46,7 @@
4546

4647
results[scheme].sort(key=lambda p: p[0])
4748

48-
symbols = ["o", "^", "s", "p"]
49+
symbols = ["o", "^", "s", "p", "*"]
4950

5051

5152
plt.figure("scaling"+"-nSpS"*useNSpS)
@@ -64,12 +65,11 @@
6465

6566

6667
plt.figure("PinT-speedup")
67-
schemes = ["SDC-MPI", "SDC-MPI2"]
6868
nProcSpace, tSDC = np.array(results["SDC"]).T
69-
for scheme, sym in zip(schemes, symbols):
69+
for scheme, sym in zip(schemes[2:], symbols):
7070
_, tSDCPinT = np.array(results[scheme]).T
7171
speedup = tSDC[:-2]/tSDCPinT
72-
plt.semilogx(nProcSpace[:-2], speedup, label=scheme)
72+
plt.semilogx(nProcSpace[:-2], speedup, sym+"-", label=scheme)
7373
plt.legend()
7474
plt.grid(True)
7575
plt.xlabel("$N_{p,S}$"), plt.ylabel("PinT Speedup")

0 commit comments

Comments
 (0)