Skip to content

AssertionError on dtype mismatch in pencil.py for small arrays #20

Open
@benlandrum

Description

@benlandrum

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.

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