Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and Optimize: Function Encapsulation and Dynamic Scheduling Enhancements in Grid Integration Module #4403

Closed

Conversation

Esperanzalukas
Copy link

  • Refactored code by encapsulating common functionalities into a reusable function process_sparse_matrix.
  • The process_sparse_matrix function now supports both general sparse matrix processing and specific dim-based distribution.
  • Introduced dynamic scheduling with adjustable block sizes to optimize parallel computations, leveraging the number of available threads to set appropriate chunk sizes.

@mohanchen mohanchen changed the title Refactor and Optimize: Function Encapsulation and Dynamic Scheduling Enhancements Refactor and Optimize: Function Encapsulation and Dynamic Scheduling Enhancements in Grid Integration Module Jun 17, 2024
auto iter = sparseMatrix.find(R_coor);
if (iter != sparseMatrix.end())
{
if (trace_lo[row] >= 0) // 使用类成员变量 trace_lo
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use English for comments.


};


inline void Gint_k::process_sparse_matrix(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please don't add function with definition in *.h, you can move it to *.hpp.

@mohanchen
Copy link
Collaborator

Since the class is over, I will close this PR. New PR is welcome.

@mohanchen mohanchen closed this Jun 18, 2024
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.

3 participants