Skip to content

Commit 1c5ab9b

Browse files
committed
add gromacs message parsing tool
1 parent 7e72a7d commit 1c5ab9b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tools/gromacs-msgs.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python
2+
3+
import glob, pprint, re
4+
5+
GROMACS_ERR_PATH = 'output/csd3/cclake-*-gcc9-ompi3-ucx/gromacs/*/*.err'
6+
7+
PATTERNS = (
8+
r'(step \d+ .* dynamic load balancing)',
9+
r'(\d+ % of the run time was [\w\s]+)',
10+
)
11+
12+
if __name__ == '__main__':
13+
paths = glob.glob(GROMACS_ERR_PATH)
14+
15+
for p in paths:
16+
descr = p.split('/')[4]
17+
_, _, atoms, _, _, _, interconnect, _, _, _, nprocs, nppn = descr.split('_')
18+
with open(p) as f:
19+
for line in f:
20+
for pat in PATTERNS:
21+
m = re.search(pat, line)
22+
if m:
23+
print(','.join((atoms, interconnect, nprocs, nppn, m.group(0))))
24+
25+
#pprint.pprint(descr)

0 commit comments

Comments
 (0)