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

AssertionError for number of processors equals array dimension #21

Open
benlandrum opened this issue Mar 21, 2023 · 0 comments
Open

AssertionError for number of processors equals array dimension #21

benlandrum opened this issue Mar 21, 2023 · 0 comments

Comments

@benlandrum
Copy link

This probably doesn't happen often in practice, but using 3 processors for the below code triggers an assertion error in pencil.py (link to line). 2 processors causes no problems.

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

# This works on 2 processors, but not 3.
shape = np.array((2, 2, 3), 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)

If this case is not supported, I would like to request that this raise an exception with descriptive text rather than just hit an assert.

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

No branches or pull requests

1 participant