Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for in-place transforms #5

Merged
merged 35 commits into from
Jan 17, 2020
Merged

Add support for in-place transforms #5

merged 35 commits into from
Jan 17, 2020

Conversation

jipolanco
Copy link
Owner

No description provided.

The in-place versions of allocate_input and allocate_output now return a
ManyPencilArray.
The removed lines are only correct with 1 process...
It failed when the permutation was `nothing`, and Julia 1.2 doesn't like
printing `nothing`.
On Julia 1.2, the ManyPencilArray constructor fails for a reason that I
don't understand. It seems to expect a different constructor signature
from the one that actually exists. Things work without any problem on
Julia 1.3.

Below is the error.

ManyPencilArray: Error During Test at /home/jpolanco/.julia/dev/PencilFFTs/test/pencils.jl:151
  Got exception outside of a @test
  MethodError: no method matching (::getfield(PencilFFTs.Pencils, Symbol("##ManyPencilArray#30#31")))(::Tuple{}, ::Type{ManyPencilArray}, ::Tuple{Pencil{3,2,Float64,Nothing},Pencil{3,2,Float64,Val{(2, 3, 1)}},Pencil{3,2,Float64,Val{(3, 2
, 1)}}})
  Closest candidates are:
    #ManyPencilArray#30(::Tuple{Vararg{Int64,N}} where N, ::Type{ManyPencilArray}, !Matched::Pencil{N,X,T,P} where P where X where N...) where {M, T} at /home/jpolanco/.julia/dev/PencilFFTs/src/Pencils/multiarrays.jl:28
  Stacktrace:
   [1] ManyPencilArray(::Pencil{3,2,Float64,Nothing}, ::Pencil{3,2,Float64,Val{(2, 3, 1)}}, ::Pencil{3,2,Float64,Val{(3, 2, 1)}}) at /home/jpolanco/.julia/dev/PencilFFTs/src/Pencils/multiarrays.jl:28
   [2] test_multiarrays(::Pencil{3,2,Float64,Nothing}, ::Pencil{3,2,Float64,Val{(2, 3, 1)}}, ::Pencil{3,2,Float64,Val{(3, 2, 1)}}) at /home/jpolanco/.julia/dev/PencilFFTs/test/pencils.jl:81
   [3] macro expansion at /home/jpolanco/.julia/dev/PencilFFTs/test/pencils.jl:152 [inlined]
   [4] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.2/Test/src/Test.jl:1113 [inlined]
   [5] main() at /home/jpolanco/.julia/dev/PencilFFTs/test/pencils.jl:152
   [6] top-level scope at /home/jpolanco/.julia/dev/PencilFFTs/test/pencils.jl:325
   [7] include at ./boot.jl:328 [inlined]
   [8] include_relative(::Module, ::String) at ./loading.jl:1094
   [9] include(::Module, ::String) at ./Base.jl:31
   [10] exec_options(::Base.JLOptions) at ./client.jl:295
   [11] _start() at ./client.jl:464
Some stuff is still missing, including the `*` and `\` operators.
Make it work with Integer types other than Int.
The "pairs" version allocates a bit less:

Using iterators:

    In-place forward FFT...    890.939 μs (28 allocations: 1.64 KiB)
    In-place backward FFT...   900.662 μs (30 allocations: 1.67 KiB)

Using pairs:

    In-place forward FFT...    892.784 μs (20 allocations: 1.44 KiB)
    In-place backward FFT...   894.653 μs (20 allocations: 1.44 KiB)

This reverts commit 00c8e04.
Test fails: in-place transforms with 1D decomposition in 3D.
This fixes in-place transforms with 1D decomposition in 3D.

(More generally, it fixes M-dimensional decomposition in N dimensions,
with M <= N - 2).
Also, removed pointer(::PencilArray).
This defines *, \, mul!, ldiv! for in-place transforms, and improves
error checking.
(for in-place transforms)
@jipolanco jipolanco marked this pull request as ready for review January 17, 2020 17:13
@jipolanco jipolanco merged commit dd14657 into master Jan 17, 2020
@jipolanco jipolanco deleted the in-place branch January 17, 2020 17:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant