Skip to content

Commit

Permalink
generate module overview table for DAOS
Browse files Browse the repository at this point in the history
also, cleanup file/object terminology in job summary
  • Loading branch information
shanedsnyder committed Nov 12, 2024
1 parent 24b1891 commit e44ea71
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions darshan-util/pydarshan/darshan/backend/cffi_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"APXC",
"APMPI",
"HEATMAP",
"DFS",
"DAOS",
]
def mod_name_to_idx(mod_name):
return _mod_names.index(mod_name)
Expand Down
5 changes: 3 additions & 2 deletions darshan-util/pydarshan/darshan/cli/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def register_figures(self):
sect_title = f"Per-Module Statistics: {mod}"

try:
if mod in ["POSIX", "MPI-IO", "STDIO"]:
if mod in ["POSIX", "MPI-IO", "STDIO", "DFS", "DAOS"]:
# get the module's record dataframe and then pass to
# Darshan accumulator interface to generate a cumulative
# record and derived metrics
Expand All @@ -526,9 +526,10 @@ def register_figures(self):
fig_grid_area="overview")
self.figures.append(mod_overview_fig)

data_type = "File" if mod != "DAOS" else "Object"
file_count_summary_fig = ReportFigure(
section_title=sect_title,
fig_title=f"File Count Summary <br> (estimated by {mod} I/O access offsets)",
fig_title=f"{data_type} Count Summary <br> (estimated by {mod} I/O access offsets)",
fig_func=log_file_count_summary_table,
fig_args=dict(derived_metrics=acc.derived_metrics,
mod_name=mod),
Expand Down
18 changes: 10 additions & 8 deletions darshan-util/pydarshan/darshan/lib/accum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@

def log_file_count_summary_table(derived_metrics,
mod_name: str):
data_type = "files" if mod_name != "DAOS" else "objects"
# the darshan_file_category enum is not really
# exposed in CFFI/Python layer, so we effectively
# re-export the content indices we need here
# so that we can properly index the C-level data
darshan_file_category = {"total files":0,
"read-only files":1,
"write-only files":2,
"read/write files":3}
darshan_file_category = {f"total {data_type}":0,
f"read-only {data_type}":1,
f"write-only {data_type}":2,
f"read/write {data_type}":3}
df = pd.DataFrame.from_dict(darshan_file_category, orient="index")
df.rename(columns={0:"index"}, inplace=True)
df.index.rename('type', inplace=True)
df["number of files"] = np.zeros(4, dtype=int)
df[f"number of {data_type}"] = np.zeros(4, dtype=int)
df["avg. size"] = np.zeros(4, dtype=str)
df["max size"] = np.zeros(4, dtype=str)

Expand Down Expand Up @@ -59,9 +60,10 @@ def log_module_overview_table(derived_metrics,
mod_overview = []
total_cat = derived_metrics.category_counters[0]

total_files = total_cat.count
indices = ["files accessed", "bytes read", "bytes written", "I/O performance estimate"]
mod_overview.append(f"{total_files}")
total_count = total_cat.count
data_type = "files" if mod_name != "DAOS" else "objects"
indices = [f"{data_type} accessed", "bytes read", "bytes written", "I/O performance estimate"]
mod_overview.append(f"{total_count}")
total_bytes_read = total_cat.total_read_volume_bytes
total_bytes_read_str = humanize.naturalsize(total_bytes_read, binary=True, format="%.2f")
total_bytes_written = total_cat.total_write_volume_bytes
Expand Down

0 comments on commit e44ea71

Please sign in to comment.