[Python-talk] SWIG tips? Howto?
Kent Johnson
kent37 at tds.net
Wed Aug 19 08:05:25 EDT 2009
On Tue, Aug 18, 2009 at 9:37 PM, Bruce
Labitt<bruce.labitt at myfairpoint.net> wrote:
> Kent Johnson wrote:
>>
>> On Tue, Aug 18, 2009 at 3:07 PM, <bruce.labitt at autoliv.com> wrote:
>>> I have used FFTW before (www.fftw.org) for my work. How hard would it be
>>> to use SWIG to wrap a few FFTW routines to hopefully speed up the FFTs?
>>>
>>
>> Google is your friend...
>> http://developer.berlios.de/projects/pyfftw/
>> http://www.nabble.com/FFTW-python-bindings-again-td21676636.html
>
> Looks like there are some warts still. Memory alignment for one thing. May
> still be worth pursuing.
You would have the same issues if you were to roll your own, I think...
>> or you could communicate through sockets...
>>
>
> Just looked at that. This would very cool.
You might be able to find some kind of socket server for the QS22 to
help you get started with the code.
>
> Once the connection was established, I need to send the array length N, then
> the data. It is not clear to me how to send an array of N binary complex
> double precision numbers, from a little endian to a big endian machine over
> a socket. I could send them as strings, but that a) would not be as precise
> and b) take at least twice as long.
Use the Python struct module to generate the array in the byte-order you need.
> If all the data was there, then the algorithm would run. When complete the
> QS22 would send the data to a python socket that was listening on my server.
> Could the python socket be controlled by paramiko? Or would I use another
> module?
The python socket would be part of your main program. The only need
for paramiko would be to start the remote process that listens for
data requests.
Kent
More information about the Python-talk
mailing list