jipolanco / PencilFFTs.jl

Fast Fourier transforms of MPI-distributed Julia arrays
https://jipolanco.github.io/PencilFFTs.jl/dev/
MIT License
77 stars 7 forks source link

Error making plan with `NoTransform!()` #45

Closed glwagner closed 2 years ago

glwagner commented 2 years ago

This code:

using MPI
using PencilFFTs
MPI.Init()

comm = MPI.COMM_WORLD

transforms = (
    PencilFFTs.Transforms.NoTransform!(),
    PencilFFTs.Transforms.FFT!(),
    PencilFFTs.Transforms.FFT!(),
)

plan = try
    PencilFFTs.PencilFFTPlan((16, 32, 64), transforms, (2, 1), comm)
catch err
    if MPI.Comm_rank(comm) == 0
        @show err
    end

    nothing
end

isnothing(plan) && error("Error when making plan")

input = PencilFFTs.allocate_input(plan)

data = rand(size(first(input))...)
first(input) .= data

MPI.Comm_rank(comm) == 0 && @show maximum(abs, parent(last(input)))

plan * input

MPI.Comm_rank(comm) == 0 && @show maximum(abs, parent(last(input)))

Gives:

err = TypeError(:PencilPlan1D, "FFTPlanF", FFTPlanF<:Union{PencilFFTs.Transforms.AbstractCustomPlan, FFTW.FFTWPlan}, PencilFFTs.Transforms.IdentityPlan!)

It works if we use FFT!() instead of NoTransform!().

glwagner commented 2 years ago

I get the same error no matter where NoTransform!() appears in the list of transforms.