Skip to content
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

New version: FFTW v1.5.0 #62829

Merged
merged 1 commit into from
Jun 21, 2022
Merged

Conversation

JuliaRegistrator
Copy link
Contributor

UUID: 7a1cc6ca-52ef-59f5-83cd-3a7055c09341
Repo: https://github.com/JuliaMath/FFTW.jl.git
Tree: 90630efff0894f8142308e334473eba54c433549

Registrator tree SHA: 8e1a5ac2695627143951512d700c7e3c445102ec
JuliaRegistrator referenced this pull request in JuliaMath/FFTW.jl Jun 21, 2022
* Add get_num_threads

This commit adds `get_num_threads`, which returns the number of threads used by
the planner, and is the complement to `set_num_threads`. This simply wraps the
function `fftw_planner_nthreads`, which was
[newly added to fftw in version 3.3.9](https://github.com/FFTW/fftw3/blob/34082eb5d6ed7dc9436915df69f376c06fc39762/NEWS#L3).

* Set FFTW_jll compat to 3.3.9

`get_num_threads` requires FFTW_jll v3.3.9+7, but it doesn't seem possible to
specify a particular build in the compat section of Project.toml files. However,
this should work in most cases, as the most recent build of `FFTW_jll` should be
downloaded upon updating.

* bump to 1.3 for the new function

* Make test for get_num_threads fftw specific

No equivalent function for mkl

* Typo...

* another typo

* Add vendor check to `get_num_threads`

* Add a method of `set_num_threads` that restores the original nthreads

Additionally, separate previous `set_num_threads` method into a base function,
`_set_num_threads`, that wraps the `ccalls`, and `set_num_threads`, which will
acquire the `fftwlock`.

* Provide support for `get_num_threads` with MKL's FFTW

While MKL's FFTW does not provide access to the number of threads available to
the planner, this can be simulated by caching the value last passed to
`set_num_threads` and returning it with `get_num_threads` if
`fftw_vendor == :mkl`.

* Implement suggestions of @stevengj

* Fix typo in set_num_threads

* Add test for set_num_threads method that restores original num_threads

* Rename `nthreads` variable to `num_threads` to avoid shadowing Threads.nthreads

Since FFTW uses `Base.Threads`, and `nthreads` is a function defined in
`Base.Threads`, then the function argument `nthreads` shadows a function already
in the namespace of every function. While there is no inherent issue with this,
it can make debugging this code more confusing.

* Make one-line method of `set_num_threads` one line.

* First attempt at adding `num_threads` to `plan_...` functions

As suggested by @stevengj, I have add a `num_threads` keyword to the `plan_...`
functions. My approach here is fairly naive, and adds a bunch of redundant
boiler plate code to every `plan_` function.

Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Mosè Giordano <[email protected]>
@JuliaRegistrator JuliaRegistrator temporarily deployed to stopwatch June 21, 2022 23:21 Inactive
@github-actions
Copy link
Contributor

Your new version pull request met all of the guidelines for auto-merging and is scheduled to be merged in the next round.


If you want to prevent this pull request from being auto-merged, simply leave a comment. If you want to post a comment without blocking auto-merging, you must include the text [noblock] in your comment.

@JuliaTagBot JuliaTagBot merged commit 835fd38 into master Jun 21, 2022
@JuliaTagBot JuliaTagBot deleted the registrator/fftw/7a1cc6ca/v1.5.0 branch June 21, 2022 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants