mpi4py-fft icon indicating copy to clipboard operation
mpi4py-fft copied to clipboard

AssertionError on dtype mismatch in pencil.py for small arrays

Open benlandrum opened this issue 2 years ago • 0 comments

3D transforms with a small index-2 lengths encounter AssertionError in pencil.py (link to line).

import numpy as np
from mpi4py import MPI
from mpi4py_fft import PFFT, newDistArray

# No assertion error for (5, 5, 3).
shape = np.array((5, 5, 2), dtype=int)

fft = PFFT(MPI.COMM_WORLD, shape=shape, dtype=float)

u = newDistArray(fft, forward_output=False)
u[...] = np.random.random(u.shape).astype(u.dtype)

u_hat = newDistArray(fft, forward_output=True)

# AssertionError
fft.forward(u, u_hat)

An array with dimensions (5, 5, 3) is fine, but (5, 5, 2) doesn't work.

I am using version 2.0.4.

benlandrum avatar Mar 21 '23 01:03 benlandrum