Skip to content

Conversation

@izzet
Copy link
Collaborator

@izzet izzet commented Nov 30, 2025

This pull request refactors the trace analysis logic in the dftracer analyzer, 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_hlm method, 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_trace into 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_hlm pipeline, with stricter validation to ensure only the POSIX layer is supported.

Type and Enum Improvements:

  • Changed the Layer enum to inherit from LowercaseStrEnum for consistent lowercase string representation, and updated imports accordingly. [1] [2] [3]

  • Updated the AnalyzerResultType dataclass to make _traces optional 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_count to unique_process_count for clarity.

  • Ensured that proc_name is constructed using the correct application name in the Darshan file name view, improving consistency.

Helper Method Extraction:

  • Added a new helper method ensure_proc_view_type to centralize the logic for ensuring COL_PROC_NAME is 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.

…g; introduce ensure_proc_view_type method for view type management.
…ess naming convention; refactor analysis method to support HLM processing.
…tialization; move optional fields to the end of the class definition.
@izzet izzet self-assigned this Nov 30, 2025
@izzet izzet added the bug Something isn't working label Nov 30, 2025
@izzet izzet requested a review from Copilot November 30, 2025 06:58
@izzet izzet changed the title Fix/darshan layer defs [Compat] Darshan layer definitions Nov 30, 2025
Copilot finished reviewing on behalf of izzet November 30, 2025 07:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_hlm method
  • Changed Layer enum to LowercaseStrEnum for consistency with lowercase config keys
  • Fixed naming consistency (unique_proc_countunique_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.

izzet and others added 11 commits November 30, 2025 01:03
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@izzet izzet merged commit 98d76f2 into develop Nov 30, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants