-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.