From 3a60756975610558587d641920dce1a7ba0c886d Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Tue, 9 Dec 2025 16:44:40 -0800 Subject: [PATCH 1/2] include support for thread_id in Darshan DXT --- explorer/dxt.py | 24 +----------------------- explorer/plots/operation.py | 17 +++++++++-------- explorer/plots/spatiality.py | 6 ++++++ explorer/plots/transfer.py | 5 +++++ 4 files changed, 21 insertions(+), 31 deletions(-) diff --git a/explorer/dxt.py b/explorer/dxt.py index 5c52378..08058f2 100644 --- a/explorer/dxt.py +++ b/explorer/dxt.py @@ -268,6 +268,7 @@ def create_dataframe( "start", "end", "osts", + "pthread_id" ] total_logs = 0 runtime = 0 @@ -1170,29 +1171,6 @@ def generate_index(self, file, report): "You can open the index.html file in your browser to interactively explore all plots" ) - def check_log_version(self, file, log_version, library_version): - use_file = file - if version.parse(log_version) < version.parse(library_version): - use_file = file.replace(".darshan", ".converted.darshan") - self.logger.info( - 'Converting .darshan log from {} to {}: format: saving output file "{}" in the current working directory.'.format( - log_version, library_version, use_file - ) - ) - - if not os.path.isfile(use_file): - ret = os.system("darshan-convert {} {}".format(file, use_file)) - - if ret != 0: - self.logger.error( - "Unable to convert .darshan file to version {}".format( - library_version - ) - ) - - return use_file - - def main(): PARSER = argparse.ArgumentParser(description="DXT Explorer: ") diff --git a/explorer/plots/operation.py b/explorer/plots/operation.py index e68e5e9..7c956e1 100644 --- a/explorer/plots/operation.py +++ b/explorer/plots/operation.py @@ -19,7 +19,7 @@ def add_trace_to_graph(dataframe, color_scale=None, stragglers=False): if stragglers: custom_data = ["rank", "duration"] else: - custom_data = ["rank", "duration", "size", "offset", "osts"] + custom_data = ["rank", "duration", "size", "offset", "osts", "pthread_id"] fig.add_traces( list( @@ -229,8 +229,8 @@ def determine_legend(fig, column): if df.empty: quit() -df["osts"].fillna(value="-", inplace=True) -df.drop(df.tail(2).index, inplace=True) +df["osts"] = df["osts"].astype(object).fillna("-") +df["pthread_id"] = df["pthread_id"].astype(object).fillna("-") if not options["graph_type"]: if options["start"] is not None: @@ -590,7 +590,7 @@ def determine_legend(fig, column): error_x="duration", render_mode="auto", facet_row=facet_row, - custom_data=["rank", "duration", "size", "offset", "osts"], + custom_data=["rank", "duration", "size", "offset", "osts", "pthread_id"], color_discrete_sequence=["#d0e6f5", "#f7d8d5"], category_orders=category_orders, ) @@ -617,7 +617,7 @@ def determine_legend(fig, column): render_mode="auto", facet_row=facet_row, color_discrete_sequence=["#3c93c2", "#f0746e"], - custom_data=["rank", "duration", "size", "offset", "osts"], + custom_data=["rank", "duration", "size", "offset", "osts", "pthread_id"], category_orders=category_orders, ) @@ -774,7 +774,8 @@ def determine_legend(fig, column): "Duration: %{customdata[1]}", "Size: %{customdata[2]}", "Offset: %{customdata[3]}", - "Osts: %{customdata[4]}", + "Lustre OSTs: %{customdata[4]}", + "Thread ID: %{customdata[5]}", ] ) ) @@ -901,10 +902,10 @@ def determine_legend(fig, column): with open(options["output"], "r") as html_file: output_doc.body.extend(BeautifulSoup(html_file.read(), "html.parser").body) - with open(file + ".darshan.html", "r") as html_file: + with open(file + ".html", "r") as html_file: output_doc.head.extend(BeautifulSoup(html_file.read(), "html.parser").head) - with open(file + ".darshan.html", "r") as html_file: + with open(file + ".html", "r") as html_file: output_doc.body.extend(BeautifulSoup(html_file.read(), "html.parser").body) output_doc.style.append(BeautifulSoup("pre { padding-left: 60px;}", "html.parser")) diff --git a/explorer/plots/spatiality.py b/explorer/plots/spatiality.py index 9fc558d..f43d806 100644 --- a/explorer/plots/spatiality.py +++ b/explorer/plots/spatiality.py @@ -42,6 +42,9 @@ if df.empty: quit() +df["osts"] = df["osts"].astype(object).fillna("-") +df["pthread_id"] = df["pthread_id"].astype(object).fillna("-") + df["duration"] = df["end"] - df["start"] rank_gap = max(df["rank"]) * 0.075 maximum_rank = max(df["rank"]) @@ -77,6 +80,9 @@ def paste0(): label = label + "-" else: label = label + df["osts"].apply(str) + + label += "
" + "Thread ID: " + df["pthread_id"].apply(str) + return label diff --git a/explorer/plots/transfer.py b/explorer/plots/transfer.py index b582869..1ec28d3 100644 --- a/explorer/plots/transfer.py +++ b/explorer/plots/transfer.py @@ -69,6 +69,8 @@ if df.empty: quit() +df["osts"] = df["osts"].astype(object).fillna("-") + df["duration"] = df["end"] - df["start"] duration = max(df["end"]) - min(df["start"]) @@ -125,6 +127,9 @@ def paste0(): label = label + "-" else: label = label + df["osts"].apply(str) + + label += "
" + "Thread ID: " + df["pthread_id"].apply(str) + return label From 0bde3e3ca8b2a4057e5cee4fb4891d154015825d Mon Sep 17 00:00:00 2001 From: Jean Luca Bez Date: Tue, 9 Dec 2025 16:47:54 -0800 Subject: [PATCH 2/2] fix linter --- explorer/dxt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/explorer/dxt.py b/explorer/dxt.py index 08058f2..ccaba3e 100644 --- a/explorer/dxt.py +++ b/explorer/dxt.py @@ -37,7 +37,6 @@ # import darshan.backend.cffi_backend as darshanll from explorer import version as dxt_version -from packaging import version class Explorer: @@ -1171,6 +1170,7 @@ def generate_index(self, file, report): "You can open the index.html file in your browser to interactively explore all plots" ) + def main(): PARSER = argparse.ArgumentParser(description="DXT Explorer: ")