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

mpm_grid_op kernel optimization - coupler.py #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ardabck
Copy link

@ardabck ardabck commented Dec 19, 2024

Optimize mpm_grid_op kernel for performance and readability

  • Precomputed frequently used variables pos and mass_mpm to eliminate redundant calculations within the kernel.
  • Used ti.static for conditional checks on solver activity (Tool, Rigid, SPH, PBD) to enable Taichi compiler optimizations.
  • Improved code readability and maintainability while retaining original functionality.
  • Enhanced coupling efficiency for MPM <-> SPH and MPM <-> PBD by reducing computational overhead in nested loops.

This update enhances the overall performance of the mpm_grid_op kernel and lays groundwork for further optimizations.

Optimize mpm_grid_op kernel for performance and readability

- Precomputed frequently used variables `pos` and `mass_mpm` to eliminate redundant calculations within the kernel.
- Used `ti.static` for conditional checks on solver activity (Tool, Rigid, SPH, PBD) to enable Taichi compiler optimizations.
- Improved code readability and maintainability while retaining original functionality.
- Enhanced coupling efficiency for MPM <-> SPH and MPM <-> PBD by reducing computational overhead in nested loops.

This update enhances the overall performance of the `mpm_grid_op` kernel and lays groundwork for further optimizations.
@zhouxian
Copy link
Collaborator

zhouxian commented Dec 22, 2024

Thank you for (such a professional) PR! For prs like this, we would need someone to look into in detail, so please give us a bit time :)

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.

2 participants