-
Notifications
You must be signed in to change notification settings - Fork 438
R2X silently assumes zero-based domain indexing #5049
Copy link
Copy link
Closed
Description
- Type: Correctness / Indexing assumptions
- Severity: High
- Component: FFT
R2Xdomain setup - Location:
Src/FFT/AMReX_FFT_R2X.H:259Src/FFT/AMReX_FFT_R2X.H:267Src/FFT/AMReX_FFT_R2X.H:299
Problem
R2X stores m_dom_rx = m_dom_0 (original box), but several derived domains are built with smallEnd = 0 and mixed length(...)/bigEnd(...) expressions. If domain.sm\ allEnd() != 0, later setBig(...) operations can generate invalid or truncated boxes.
Impact
- Wrong internal layouts for non-zero-origin domains.
- Potential invalid boxes, copy failures, or incorrect FFT results.
Suggested patch
If non-zero-origin support is not implemented in R2X, fail fast with an explicit invariant check.
--- a/Src/FFT/AMReX_FFT_R2X.H
+++ b/Src/FFT/AMReX_FFT_R2X.H
@@
AMREX_ALWAYS_ASSERT((m_dom_0.numPts() > 1) && (m_info.batch_size == 1));
+ AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
+ m_dom_0.smallEnd() == IntVect(AMREX_D_DECL(0,0,0)),
+ "FFT::R2X currently requires domain.smallEnd() == 0");Prepared by Codex
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels