Skip to content

Refactor: hs file output #7367

Open
goodchong wants to merge 3 commits into
deepmodeling:developfrom
goodchong:inandout
Open

Refactor: hs file output #7367
goodchong wants to merge 3 commits into
deepmodeling:developfrom
goodchong:inandout

Conversation

@goodchong
Copy link
Copy Markdown
Collaborator

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #6837

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Extended out_mat_hs2 to map integers 0 to 4 (disabled, single-file text/binary, and multi-file text/binary).
  • Maintained backward compatibility with string boolean inputs ('true', 'false', 'yes', 'no').
  • Added support for rank suffixes (.0, .1, etc.) for multi-file CSR and position matrix outputs when reduce is false.
  • Refactored output_HSR to use a clean templated loop structure, eliminating duplicate code blocks.
  • Optimized parallel CSR output performance using in-memory collective MPI gathering (MPI_Gatherv), replacing slow disk-based row-by-row gathering.

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

goodchong added 3 commits May 20, 2026 09:01
- Extended out_mat_hs2 to map integers 0 to 4 (disabled, single-file text/binary, and multi-file text/binary).
- Maintained backward compatibility with string boolean inputs ('true', 'false', 'yes', 'no').
- Added support for rank suffixes (.0, .1, etc.) for multi-file CSR and position matrix outputs when reduce is false.
- Refactored output_HSR to use a clean templated loop structure, eliminating duplicate code blocks.
- Optimized parallel CSR output performance using in-memory collective MPI gathering (MPI_Gatherv), replacing slow disk-based row-by-row gathering.
@goodchong goodchong changed the title refactor hs file output Refactor: hs file output May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The output of the Module::output singleR function is inconvenient to use when reduce == false in a multi-process environment

1 participant