Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BENCH: profile memleaks asv #821

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
42 changes: 42 additions & 0 deletions darshan-util/pydarshan/benchmarks/benchmarks/cffi_backend.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import darshan
from darshan.backend import cffi_backend
from darshan.log_utils import get_log_path


class RetrieveLogData:
# see gh-811

# TODO: maybe produce a version of the log that also
# has runtime HEATMAP to guard memory leaks on that module;
# part of the issue here is
# perhaps the following to pull in new log repo files:
# https://github.com/darshan-hpc/darshan-logs/issues/15

params = ['POSIX', 'MPI-IO', 'H5F', 'H5D', 'LUSTRE', 'STDIO', 'DXT_POSIX', 'DXT_MPIIO']
param_names = ["module"]


def setup(self, module):
self.ior_log_path = get_log_path("ior_hdf5_example.darshan")


def peakmem_log_get_record(self, module):
for i in range(100000):
log = cffi_backend.log_open(self.ior_log_path)
rec = cffi_backend.log_get_record(log, module)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since log_get_record() automatically dispatches to _log_get_heatmap_record() when HEATMAP module is requested, I think we'll just automatically cover our bases for the memory leaks when a log file with += HEATMAP is used here.

cffi_backend.log_close(log)


def peakmem_log_get_mounts(self, module):
for i in range(10000):
log = cffi_backend.log_open(self.ior_log_path)
rec = cffi_backend.log_get_mounts(log)
cffi_backend.log_close(log)


def peakmem_log_get_name_recs(self, module):
for i in range(10000):
with darshan.DarshanReport(self.ior_log_path,
read_all=True,
lookup_name_records=True) as report:
pass