Conversation
…g; introduce ensure_proc_view_type method for view type management.
…ess naming convention; refactor analysis method to support HLM processing.
…nventions in access patterns.
…tialization; move optional fields to the end of the class definition.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the dftracer analyzer to modularize the high-level metric (HLM) and view computation pipeline. The main changes extract complex analysis logic into a new _analyze_hlm helper method to improve code reuse and maintainability. Additional changes include updating the Layer enum to use LowercaseStrEnum for consistency with config dictionaries, reordering dataclass fields for clarity, fixing a naming inconsistency in metrics, and adding a helper method to ensure process view types.
- Extracted HLM analysis pipeline into reusable
_analyze_hlmmethod - Changed
Layerenum toLowercaseStrEnumfor consistency with lowercase config keys - Fixed naming consistency (
unique_proc_count→unique_process_count)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| python/dftracer/analyzer/types.py | Reordered AnalyzerResultType dataclass fields and made _traces optional with default value |
| python/dftracer/analyzer/darshan.py | Updated to use new _analyze_hlm method, added layer validation, fixed metric naming, improved proc_name construction |
| python/dftracer/analyzer/constants.py | Changed Layer enum from StrEnum to LowercaseStrEnum |
| python/dftracer/analyzer/analyzer.py | Extracted view computation logic into new _analyze_hlm method, added ensure_proc_view_type helper method |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors the trace analysis logic in the
dftraceranalyzer, focusing on modularizing the high-level metric (HLM) and view computation pipeline. The main changes include extracting a large block of logic into a new_analyze_hlmmethod, improving code reuse and clarity, and updating type and enum usage for consistency. There are also some minor bug fixes and improvements to naming and typing.Core Refactoring and Pipeline Modularization:
Extracted the logic for computing layers, views, flat views, metric boundaries, and checkpointing from
analyze_traceinto a new helper method_analyze_hlm, simplifying the main analysis function and enabling code reuse in specialized analyzers. [1] [2]Updated the Darshan analyzer to use the new
_analyze_hlmpipeline, with stricter validation to ensure only the POSIX layer is supported.Type and Enum Improvements:
Changed the
Layerenum to inherit fromLowercaseStrEnumfor consistent lowercase string representation, and updated imports accordingly. [1] [2] [3]Updated the
AnalyzerResultTypedataclass to make_tracesoptional with a default value, and reordered fields for clarity.Bug Fixes and Naming Consistency:
Fixed a naming inconsistency in the Darshan analyzer result metrics: renamed
unique_proc_counttounique_process_countfor clarity.Ensured that
proc_nameis constructed using the correct application name in the Darshan file name view, improving consistency.Helper Method Extraction:
ensure_proc_view_typeto centralize the logic for ensuringCOL_PROC_NAMEis always included in view types. [1] [2]These changes improve maintainability, clarity, and correctness of the analysis pipeline, especially as more analyzers or view types are added in the future.