Skip to content

Column major fix of apply markers bc - #348

Open
max-models wants to merge 4 commits into
develfrom
column-major-fix-of-apply-markers-bc
Open

Column major fix of apply markers bc#348
max-models wants to merge 4 commits into
develfrom
column-major-fix-of-apply-markers-bc

Conversation

@max-models

@max-models max-models commented Aug 17, 2026

Copy link
Copy Markdown
Member
  • Added a pre-allocated self._eta_bc_buf = xp.zeros((self.n_rows, 3)) buffer
  • _find_outside_particles(axis, eta=None) now optionally reads from this small contiguous (n_rows, 3) buffer instead of striding a single column out of the full row-major markers array.
  • apply_kinetic_bc now does one self._eta_bc_buf[:] = self.markers[:, :3] copy per BC-type block (only when that axis list is non-empty), then passes eta=self._eta_bc_buf into every _find_outside_particles call in that block. The buffer is refreshed fresh at the start of each block.

Measured the improvement to be approximately 1.3x speedup, not huge but not too bad.

Merge after #347

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.

1 participant