Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
darshan
darshan
Commits
1e67c1db
Commit
1e67c1db
authored
Oct 22, 2020
by
Jakob Luettgau
Browse files
Update report.to_dict to tolerate missing counters/fcounters.
parent
8190931a
Changes
1
Hide whitespace changes
Inline
Side-by-side
darshan-util/pydarshan/darshan/report.py
View file @
1e67c1db
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment