First attempt at adding planner_nthreads#205
Conversation
While you can currently set the maximum number of threads used by the planner, there is no way to check that number. This simply adds a new function, `planner_nthreads`, that provides this information, as was suggested by @stevengj.
In an attempt to verify that planner_nthreads works as intended, I have added an assertion in `fftw-bench.c` that `planner_nthreads` returns the nthreads just passed as an argument to `plan_with_nthreads`.
|
I successfully built this branch, and added a test of I'm not sure if this is the best place to test this new function, or if there are other tests that should also be added. If so, I would be happy to add them to this PR. |
|
LGTM. Probably you could add a test after this line, of the form: BENCH_ASSERT(FFTW(planner_nthreads)() == nthreads);There is also some copyright-assignment paperwork that MIT requires for contributions to FFTW; @matteo-frigo, can you point @galenlynch in the right direction for this? |
I think that's the exact test that I added in the second commit of this PR, which is great! Happy to do whatever paperwork is required. I'm a MIT employee if that makes a difference. |
|
Is this ok to merge? |
* First attempt at adding planner_nthreads While you can currently set the maximum number of threads used by the planner, there is no way to check that number. This simply adds a new function, `planner_nthreads`, that provides this information, as was suggested by @stevengj. * Add basic testing of planner_nthreads In an attempt to verify that planner_nthreads works as intended, I have added an assertion in `fftw-bench.c` that `planner_nthreads` returns the nthreads just passed as an argument to `plan_with_nthreads`.
While you can currently set the maximum number of threads used by the planner,
there is no way to check that number. This simply adds a new function,
planner_nthreads, that provides this information, as was suggested by@stevengj (JuliaMath/FFTW.jl#150).
I have no idea which files I should edit to introduce this new function beyond
threads/api.c, due to my unfamiliarity with autoconf and the build system used by FFTW. I have additionally addedplanner_nthreadstoapi/fftw3.h, andthreads/f77funcs.h. I was unsure how to test this new function, and I have not yet done so. I will try to figure that out soon, if someone with more experience does not do it before I can.I have also added
planner_nthreadsto all the relevant portions of the documentation that I could find.