Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions darshan-util/pydarshan/darshan/backend/cffi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,17 @@ def log_get_generic_record(log, mod_name, dtype='numpy'):
rec['file_rec_id'] = rbuf[0].file_rec_id

clst = np.copy(np.frombuffer(ffi.buffer(rbuf[0].counters), dtype=np.int64))
flst = np.copy(np.frombuffer(ffi.buffer(rbuf[0].fcounters), dtype=np.float64))
if mod_name != "LUSTRE":
flst = np.copy(np.frombuffer(ffi.buffer(rbuf[0].fcounters), dtype=np.float64))
libdutil.darshan_free(buf[0])

c_cols = counter_names(mod_name)
fc_cols = fcounter_names(mod_name)

if dtype == "numpy":
rec['counters'] = clst
rec['fcounters'] = flst
if mod_name != "LUSTRE":
rec['fcounters'] = flst

elif dtype == "dict":
rec['counters'] = dict(zip(c_cols, clst))
Expand Down
13 changes: 13 additions & 0 deletions darshan-util/pydarshan/darshan/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,16 @@ def test_heatmap_df_invalid_operation():
report = darshan.DarshanReport(log_path)
with pytest.raises(ValueError, match="invalid_op not in heatmap"):
report.heatmaps["POSIX"].to_df(ops=["invalid_op"])


@pytest.mark.parametrize("mod_name", [
"LUSTRE",
"POSIX",
"STDIO",
])
def test_mod_records(mod_name):
# regression test for gh-831
log_path = get_log_path("imbalanced-io.darshan")
report = darshan.DarshanReport(log_path)
gen = report.mod_records(mod_name)
next(gen)