Skip to content

Fix for non-contiguous arrays#653

Merged
pancetta merged 1 commit into
Parallel-in-Time:masterfrom
brownbaerchen:quick_fix
Jun 12, 2026
Merged

Fix for non-contiguous arrays#653
pancetta merged 1 commit into
Parallel-in-Time:masterfrom
brownbaerchen:quick_fix

Conversation

@brownbaerchen

Copy link
Copy Markdown
Contributor

Turns out skipping the copy in #652 can lead to non-contiguous arrays that need to be cast to contiguous before writing. If the array is already contiguous, this is zero-copy.

Copilot AI review requested due to automatic review settings June 11, 2026 09:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an output-writing failure caused by non-contiguous NumPy arrays produced when skipping copies (introduced in #652), by ensuring solutions are converted to C-contiguous arrays before being written to disk. This keeps the operation zero-copy when the input is already contiguous, while safely copying otherwise.

Changes:

  • Ensure processSolutionForOutput returns a C-contiguous np.ndarray via np.ascontiguousarray(...) to prevent IO failures on non-contiguous views (including GPU-to-CPU transfers and .real views).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pySDC/implementations/problem_classes/generic_spectral.py
@tlunet

tlunet commented Jun 11, 2026

Copy link
Copy Markdown
Member

Was that the reason of the "unstable RK443" ? 😅

@brownbaerchen

Copy link
Copy Markdown
Contributor Author

Was that the reason of the "unstable RK443" ? 😅

No without this the code just crashes on CPU with more than one task. Luckily I found the issue with RK443 and fixed it in #654... So sadly RK443 is not unconditionally unstable after all :D

@pancetta pancetta merged commit 9ffcb48 into Parallel-in-Time:master Jun 12, 2026
42 checks passed
brownbaerchen added a commit to brownbaerchen/pySDC that referenced this pull request Jun 12, 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.

4 participants