Skip to content

Commit 1f0532b

Browse files
author
Shane Snyder
committed
pydarshan updates for DAOS module
1 parent c83718f commit 1f0532b

File tree

8 files changed

+84
-25
lines changed

8 files changed

+84
-25
lines changed

darshan-util/pydarshan/darshan/cli/summary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ def register_figures(self):
484484

485485
# for the operation counts, since the `H5D` variant contains
486486
# both modules' data, we either want `H5F` or `H5D`, not both
487-
opcounts_mods = ["POSIX", "MPI-IO", "STDIO", "DFS"]
487+
opcounts_mods = ["POSIX", "MPI-IO", "STDIO", "DFS", "DAOS"]
488488
if "H5D" in self.report.modules:
489489
opcounts_mods.append("H5D")
490490
elif "H5F" in self.report.modules:
@@ -560,7 +560,7 @@ def register_figures(self):
560560
# repo
561561
pass
562562

563-
if mod in ["POSIX", "MPI-IO", "H5D", "PNETCDF_VAR", "DFS"]:
563+
if mod in ["POSIX", "MPI-IO", "H5D", "PNETCDF_VAR", "DFS", "DAOS"]:
564564
access_hist_description = (
565565
"Histogram of read and write access sizes. The specific values "
566566
"of the most frequently occurring access sizes can be found in "

darshan-util/pydarshan/darshan/experimental/aggregators/agg_ioops.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def agg_ioops(self, mode='append'):
1616
ctx = {}
1717

1818
# aggregate
19-
mods = ['MPI-IO', 'POSIX', 'STDIO', "H5F", "H5D", "PNETCDF_VAR", "PNETCDF_FILE", "DFS"]
19+
mods = ['MPI-IO', 'POSIX', 'STDIO', "H5F", "H5D", "PNETCDF_VAR", "PNETCDF_FILE", "DFS", "DAOS"]
2020
for mod in mods:
2121

2222
# check records for module are present
@@ -121,6 +121,21 @@ def agg_ioops(self, mode='append'):
121121
ctx[mod] = agg
122122
ctx[mod + '_simple'] = tmp
123123

124+
elif mod == "DAOS":
125+
tmp = {
126+
'Obj Fetches': agg[mod + '_OBJ_FETCHES'],
127+
'Obj Updates': agg[mod + '_OBJ_UPDATES'],
128+
'Obj Opens': agg[mod + '_OBJ_OPENS'],
129+
'Array Reads': agg[mod + '_ARRAY_READS'],
130+
'Array Writes': agg[mod + '_ARRAY_WRITES'],
131+
'Array Opens': agg[mod + '_ARRAY_OPENS'],
132+
'KV Gets': agg[mod + '_KV_PUTS'],
133+
'KV Puts': agg[mod + '_KV_GETS'],
134+
'KV Opens': agg[mod + '_KV_OPENS'],
135+
}
136+
ctx[mod] = agg
137+
ctx[mod + '_simple'] = tmp
138+
124139
else:
125140
# POSIX and STDIO share most counter names and are handled
126141
# together for this reason, except for metadata/sync counter

darshan-util/pydarshan/darshan/experimental/aggregators/mod_agg_iohist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def mod_agg_iohist(self, mod, mode='append'):
1212
"""
1313

1414
# sanitation and guards
15-
supported = ["POSIX", "MPI-IO", "H5D", "PNETCDF_VAR", "DFS"]
15+
supported = ["POSIX", "MPI-IO", "H5D", "PNETCDF_VAR", "DFS", "DAOS"]
1616
if mod not in supported:
1717
raise Exception("Unsupported mod_name for aggregated iohist.")
1818

darshan-util/pydarshan/darshan/experimental/plots/plot_io_cost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def get_io_cost_df(report: darshan.DarshanReport) -> Any:
109109
110110
"""
111111
io_cost_dict = {}
112-
supported_modules = ["POSIX", "MPI-IO", "STDIO", "H5F", "H5D", "PNETCDF_FILE", "PNETCDF_VAR", "DFS"]
112+
supported_modules = ["POSIX", "MPI-IO", "STDIO", "H5F", "H5D", "PNETCDF_FILE", "PNETCDF_VAR", "DFS", "DAOS"]
113113
for mod_key in report.modules:
114114
if mod_key in supported_modules:
115115
# collect the records in dataframe form

darshan-util/pydarshan/darshan/experimental/plots/plot_opcounts.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,20 @@ def gather_count_data(report, mod):
170170
mod_data['DFS_STATS'],
171171
]
172172

173+
elif mod == 'DAOS':
174+
labels = ['ObjFetch', 'ObjUpdate', 'ObjOpen', 'ArrRead', 'ArrWrite', 'ArrOpen', 'KVGet', 'KVPut', 'KVOpen']
175+
counts = [
176+
mod_data['DAOS_OBJ_FETCHES'],
177+
mod_data['DAOS_OBJ_UPDATES'],
178+
mod_data['DAOS_OBJ_OPENS'],
179+
mod_data['DAOS_ARRAY_READS'],
180+
mod_data['DAOS_ARRAY_WRITES'],
181+
mod_data['DAOS_ARRAY_OPENS'],
182+
mod_data['DAOS_KV_GETS'],
183+
mod_data['DAOS_KV_PUTS'],
184+
mod_data['DAOS_KV_OPENS'],
185+
]
186+
173187
return labels, counts
174188

175189
def plot_opcounts(report, mod, ax=None):

darshan-util/pydarshan/darshan/tests/test_plot_exp_common.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
["0-100", "101-1K", "1K-10K", "10K-100K", "100K-1M",
2121
"1M-4M", "4M-10M", "10M-100M", "100M-1G", "1G+"]
2222
),
23+
(
24+
"snyder_ior-DFS_id1057716-201712_11-8-64400-1922568413188514066_1.darshan",
25+
"DAOS",
26+
plot_access_histogram,
27+
["0-100", "101-1K", "1K-10K", "10K-100K", "100K-1M",
28+
"1M-4M", "4M-10M", "10M-100M", "100M-1G", "1G+"]
29+
),
2330
(
2431
"dxt.darshan",
2532
"POSIX",
@@ -77,6 +84,12 @@
7784
plot_opcounts,
7885
['Read', 'Readx', 'Write', 'Writex', 'Open', 'GlobalOpen', 'Lookup', 'Get Size', 'Punch', 'Remove', 'Stat'],
7986
),
87+
(
88+
"snyder_ior-DFS_id1057716-201712_11-8-64400-1922568413188514066_1.darshan",
89+
"DAOS",
90+
plot_opcounts,
91+
['ObjFetch', 'ObjUpdate', 'ObjOpen', 'ArrRead', 'ArrWrite', 'ArrOpen', 'KVGet', 'KVPut', 'KVOpen'],
92+
),
8093
(
8194
"dxt.darshan",
8295
"POSIX",

darshan-util/pydarshan/darshan/tests/test_plot_io_cost.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@
6363
[0.0, 0.0, 0.0, 0.0],
6464
[0.0, 4.515051841e-06, 0.0, 0.0],
6565
[0.001456562, 0.002266062, 0.007923812, 0.0],
66+
[0.001492562, 0.002273217, 0.007910812, 0.0],
6667
]),
67-
["POSIX", "STDIO", "DFS"],
68+
["POSIX", "STDIO", "DFS", "DAOS"],
6869
["Read", "Write", "Meta", "Wait"],
6970
),
7071
),

darshan-util/pydarshan/darshan/tests/test_report.py

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,45 +84,61 @@ def test_dfs_daos_posix_match():
8484
dfs_ior_report = darshan.DarshanReport(get_log_path("snyder_ior-DFS_id1057716-201712_11-8-64400-1922568413188514066_1.darshan"))
8585
posix_ior_report.mod_read_all_records("POSIX")
8686
dfs_ior_report.mod_read_all_records("DFS")
87-
posix_data_dict = posix_ior_report.data['records']["POSIX"].to_df()
88-
dfs_data_dict = dfs_ior_report.data['records']["DFS"].to_df()
87+
dfs_ior_report.mod_read_all_records("DAOS")
88+
posix_data_dict = posix_ior_report.data['records']["POSIX"].to_df()["counters"]
89+
dfs_data_dict = dfs_ior_report.data['records']["DFS"].to_df()["counters"]
90+
daos_data_dict = dfs_ior_report.data['records']["DAOS"].to_df()["counters"]
8991
dfs_ior_name_recs = dfs_ior_report.data["name_records"]
9092

91-
for column_name in dfs_data_dict["counters"].columns:
93+
# also gather counters for the underlying DAOS record for the DFS record
94+
# (they have the same record ID, simplifying this a bit)
95+
dfs_hash = dfs_data_dict["id"][0]
96+
daos_data_dict = daos_data_dict[daos_data_dict["id"] == dfs_hash]
97+
for column_name in dfs_data_dict.columns:
9298
# for some columns we can't reasonably expect a match
9399
# or we need to handle the data differently between POSIX
94100
# and DAOS DFS
95101
if column_name in ["id", "DFS_LOOKUPS", "DFS_DUPS", "DFS_NB_READS", "DFS_NB_WRITES",
96102
"DFS_GET_SIZES", "DFS_PUNCHES", "DFS_REMOVES", "DFS_STATS",
97-
"DFS_CHUNK_SIZE",
98-
"DFS_FASTEST_RANK", "DFS_SLOWEST_RANK"]:
103+
"DFS_CHUNK_SIZE", "DFS_FASTEST_RANK", "DFS_SLOWEST_RANK",
104+
"DFS_FASTEST_RANK_BYTES", "DFS_SLOWEST_RANK_BYTES",
105+
"DFS_MAX_READ_TIME_SIZE", "DFS_MAX_WRITE_TIME_SIZE",
106+
"DFS_GLOBAL_OPENS", "DFS_READXS", "DFS_WRITEXS"]:
99107
continue
100-
elif column_name in ["DFS_GLOBAL_OPENS", "DFS_OPENS"]:
108+
elif column_name == "DFS_OPENS":
101109
# sum these together to match the POSIX version
102-
column_name = "DFS_OPENS"
103-
dfs_data = (dfs_data_dict["counters"]["DFS_GLOBAL_OPENS"] +
104-
dfs_data_dict["counters"]["DFS_OPENS"])
105-
elif column_name in ["DFS_READS", "DFS_READXS"]:
106-
column_name = "DFS_READS"
107-
dfs_data = (dfs_data_dict["counters"]["DFS_READS"] +
108-
dfs_data_dict["counters"]["DFS_READXS"])
110+
dfs_data = (dfs_data_dict["DFS_GLOBAL_OPENS"] +
111+
dfs_data_dict["DFS_OPENS"])
112+
elif column_name == "DFS_READS":
113+
# sum these together to match the POSIX version
114+
dfs_data = (dfs_data_dict["DFS_READS"] +
115+
dfs_data_dict["DFS_READXS"])
109116
# we know the hardcoded value for certain
110117
assert dfs_data.values == 64
111-
elif column_name in ["DFS_WRITES", "DFS_WRITEXS"]:
112-
column_name = "DFS_WRITES"
113-
dfs_data = (dfs_data_dict["counters"]["DFS_WRITES"] +
114-
dfs_data_dict["counters"]["DFS_WRITEXS"])
118+
elif column_name == "DFS_WRITES":
119+
# sum these together to match the POSIX version
120+
dfs_data = (dfs_data_dict["DFS_WRITES"] +
121+
dfs_data_dict["DFS_WRITEXS"])
115122
# we know the hardcoded value for certain
116123
assert dfs_data.values == 64
117124
else:
118-
dfs_data = dfs_data_dict["counters"][column_name]
125+
dfs_data = dfs_data_dict[column_name]
119126
posix_column_name = column_name.replace("DFS", "POSIX")
120-
posix_data = posix_data_dict["counters"][posix_column_name]
127+
posix_data = posix_data_dict[posix_column_name]
121128
assert_allclose(dfs_data.values, posix_data.values)
129+
# also check the DAOS-level data
130+
daos_column_name = column_name.replace("DFS", "DAOS")
131+
if daos_column_name == "DAOS_OPENS":
132+
# this won't match exactly
133+
continue
134+
elif daos_column_name in ["DAOS_READS", "DAOS_WRITES"]:
135+
daos_column_name = daos_column_name.replace("DAOS", "DAOS_ARRAY")
136+
daos_data = daos_data_dict[daos_column_name]
122137
if column_name.endswith("BYTES_WRITTEN"):
123138
# we know the hardcoded value for certain
124139
# 256 KiB * 16
125140
assert dfs_data.values == 16777216
141+
assert daos_data.values == 16777216
126142

127143

128144
@pytest.mark.parametrize("unsupported_record",

0 commit comments

Comments
 (0)