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

Make Linear Elements Fast #850

Open
wants to merge 30 commits into
base: development
Choose a base branch
from

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Feb 12, 2025

Make linear elements as fast as possible by:

  • calculating constants that depend on the element config and reference particle properties before pushing all particles,
  • instead of using a Matrix-Vector calculation (as in LinearElement), we rely on the fact that those matrices are sparse and keep the multiply-adds explicit.

Example: 1 CPU core run of a single Quad, 100M particles
Before:

Execution time ImpactX: 5.3057 seconds (0.05306us / particle)

Now:

Execution time ImpactX: 0.8723 seconds (0.00872us / particle)

Close #849

  • decide on general structure
  • go through all 40+ elements...

@ax3l ax3l force-pushed the performance-quad-constants branch from 3c74ef7 to 9ed66b3 Compare February 12, 2025 19:33
@ax3l ax3l changed the title [Draft] Make Quad Fast [Draft] Make Quad & Drift Fast Feb 12, 2025
@ax3l ax3l force-pushed the performance-quad-constants branch 8 times, most recently from db2f5ac to 483e3df Compare February 15, 2025 00:38
@ax3l ax3l changed the title [Draft] Make Quad & Drift Fast [WIP] Make Linear Elements Fast Feb 15, 2025
@ax3l ax3l force-pushed the performance-quad-constants branch 5 times, most recently from e9cf013 to 4b4919e Compare February 19, 2025 23:17
@ax3l ax3l force-pushed the performance-quad-constants branch 4 times, most recently from 9b7fedf to f0d27d5 Compare February 20, 2025 04:44
@ax3l ax3l force-pushed the performance-quad-constants branch 2 times, most recently from 1aa4bb7 to b633a9b Compare February 20, 2025 06:34
@ax3l ax3l force-pushed the performance-quad-constants branch from b633a9b to a9ccaa5 Compare February 20, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize Lattice: Pre-Calc Constants
2 participants