-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFTW crash after using FINUFFT #61
Comments
Hi @AaronGhost, @ahbarnett I think the issue is here: https://github.com/flatironinstitute/finufft/blob/cdcccbec2585ae2ab5bf2e0be27bac1c526fa6c3/src/finufft.cpp#L764 Can we require FFTW 3.3.9 instead of 3.3.6? 3.3.9 Is quite old now. Thanks, |
I did some more tests setting both
Also unrelated but setting the |
interesting. Have you tried doing a "dummy" fftw call before the first call
to finufft? (I know this was needed in matlab). We are releasing v2.3 that
allows avoiding fftw altogether, but the Julia wrapper may take a little
while to catch up.
Re fftw option, you know it only has certain valid values, viz docs:
int fftw; // plan flags to FFTW (FFTW_ESTIMATE=64,
FFTW_MEASURE=0,...)
…On Tue, Aug 13, 2024 at 6:36 PM AaronGhost ***@***.***> wrote:
I did some more tests setting both nthreads and FFTW.set_num_threads():
- FINUFFT.jl uses the maximum number of threads on the machine even
when Julia is started with a single thread
- Setting the number of threads to 1 on both library avoid the crash
- Matching the number of threads on both libraries still trigger the
crash
Also unrelated but setting the fftw option to something >= 3 makes the
code hangs forever.
—
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZRSWG6EBR44FZY2DLWY3ZRKC2TAVCNFSM6AAAAABMOWRPTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBXGI3TSMJXGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
*-------------------------------------------------------------------~^`^~._.~'
|\ Alex Barnett Center for Computational Mathematics, Flatiron Institute
| \ http://users.flatironinstitute.org/~ahb 646-876-5942
|
This should be fine from the Julia standpoint since the latest FFTW.jl (v1.8.0) uses FFTW v3.3.9. Can this be reproduced in C++ code or is it somehow linked to the Julia interface? |
I did some additional tests:
I can trigger the last two crashes without calling FINUFFT altogether so there may be something going on with the FFTW library in julia. The crash exception happens at a different place:
I will open an issue with FFTW.jl too, I guess. I don't know if some of the issues would disappear if FINUFFT_jll built FFTW independently from FFTW.jl (#55) ? |
The number of threads used in fftw by finufft is not exactly the same as the number of threads finufft uses. But it is lower equal. Hence assigning more threads to finufft and less to fftw can not trigger the crash. |
The problem we see here is (yet another) issue with fftw use of a global state. Bundling fftw may fix the issue, but I think is better to just require fftw 3.3.9 which is shipped by fftw.jl anyway. Possibly using |
PS Steven G Johnson is intimately involved with FFTW.jl so might be the
right person to ask (on Julia Discourse) about the FFTW-only crash...
…On Wed, Aug 14, 2024 at 10:15 AM Marco Barbone ***@***.***> wrote:
The problem we see here is (*yet another*) issue with fftw use of a
global state. Bundling fftw can fix the issue, but I think is better to
just require fftw 3.3.9 which is shipped by fftw.jl anyway. Possibly using
FFTW.set_provider!("mkl") might fix the issue for now.
—
Reply to this email directly, view it on GitHub
<#61 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZRSTLSVZXRWAB6EZ32NDZRNQ7PAVCNFSM6AAAAABMOWRPTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBYHEYDCOJSHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
*-------------------------------------------------------------------~^`^~._.~'
|\ Alex Barnett Center for Computational Mathematics, Flatiron Institute
| \ http://users.flatironinstitute.org/~ahb 646-876-5942
|
I submitted an issue on FFTW.jl with the smallest FINUFFT-free example that I could get to crash: JuliaMath/FFTW.jl#306 |
Hi, thanks for putting together the bindings for FINUFFT in julia.
I obtain a crash when calling FFTW functions after some FINUFFT ones in Windows when using multi-threading. I can't trigger the same bug in Linux or in single-thread. I can't trigger the bug without running FINUFFT functions before.
I reduced the code to the best of my ability:
The crash report looks like this:
I have installed both FFTW (1.8.0) and FINUFFT (3.2.0) through Pkg.
Version info (I can reproduce under 1.10 and 1.11)
Happy to help further if possible!
Thanks
The text was updated successfully, but these errors were encountered: