Commit 1e67c1db authored by Jakob Luettgau's avatar Jakob Luettgau
Browse files

Update report.to_dict to tolerate missing counters/fcounters.

parent 8190931a
......@@ -583,7 +583,7 @@ class DarshanReport(object):
#print("Memory:", get_size(self), 'bytes')
def to_dict():
def to_dict(self):
"""
Return dictionary representation of report data.
......@@ -598,8 +598,17 @@ class DarshanReport(object):
recs = data['records']
for mod in recs:
for i, rec in enumerate(data['records'][mod]):
recs[mod][i]['counters'] = rec['counters'].tolist()
recs[mod][i]['fcounters'] = rec['fcounters'].tolist()
try:
recs[mod][i]['counters'] = rec['counters'].tolist()
except KeyError:
logger.debug(f" to_json: mod={mod} does not include counters")
pass
try:
recs[mod][i]['fcounters'] = rec['fcounters'].tolist()
except KeyError:
logger.debug(f" to_json: mod={mod} does not include fcounters")
pass
return data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment