Skip to content

Commit 1335a07

Browse files
authored
Fix parse error in pingmatrix output (#761)
When the line displaying the group of nodes used tokenises as four items, it results in a parse error when python attemmpts to cast the line as integers and floats.
1 parent 3a009f0 commit 1335a07

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ansible/roles/hpctests/library/plot_nxnlatbw.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ def run_module():
129129
if len(vals) != 4:
130130
print('warning: skipping line %i (%i values)' % (ln, len(vals)))
131131
continue
132-
rankA, rankB, lat, bw = int(vals[0]), int(vals[1]), float(vals[2]), float(vals[3])
132+
try:
133+
rankA, rankB, lat, bw = int(vals[0]), int(vals[1]), float(vals[2]), float(vals[3])
134+
except ValueError:
135+
print('warning: skipping line %i (%s) - parse failure' % (ln, line))
136+
continue
133137
latencies[rankA, rankB] = lat
134138
bandwidths[rankA, rankB] = bw
135139

0 commit comments

Comments
 (0)