[Numpy-discussion] Enhancements for NumPy's FFTs

Sturla Molden sturla@molden...
Sun Mar 15 10:19:48 CDT 2009


>> 1) I have noticed that fftpack_litemodule.c does not release the GIL
>> around calls to functions in fftpack.c. I cannot se any obvious reason
>> for
>> this. As far as I can tell, the functions in fftpack.c are re-entrant.
>>
>> 2) If fftpack_lite did release the GIL, it would allow functions in
>> numpy.fft to use multithreading for multiple FFTs in parallel
>> (threading.Thread are ok, not special compilation needed).
>
> Both are fines to modify for 1.3.

There is a version of fftpack_litemodule.c, fftpack.c and fftpack.h that
does this attached to ticket #1055. The two important changes are
releasing the GIL and using npy_intp for 64 bit support.

Minor changes:

There is a restrict qualifier in fftpack.c. If it is not compiled with
C99, it tries to use similar GNU or MS extensions.

There is some OpenMP pragmas in ftpack_litemodule.c. If you don't compile
with OpenMP support, they do nothing. If you do compile with OpenMP, they
will make certain FFTs run in parallel.  I can comment them out if you
prefer.

Sturla Molden






More information about the Numpy-discussion mailing list