Skip to content

AssertionError for number of processors equals array dimension #21

Open
@benlandrum

Description

@benlandrum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions