On Tue, 23 Mar 2010, Nevada Sanchez wrote:
You will not get very high data rates through Python (it's too slow). I
would suggest using similar code, but in C.
I'm not so sure this is always true. Depends on what number "very high"
corresponds to, what else needs to be done with the data, and the HW this
is all being run on. I'd never tried pushing high data rates through
python before, so I just did a basic test and was able to get ~350 MB/s
with no loss (8kB packets; recv-only, no processing/disk writing/etc).
On this system, the same thing in C can do about 550 MB/s before it starts
losing data.
And I've found python extremely useful for writing quick programs to check
that the data coming out of the instrument makes sense, or test various
things, without having to go to a full-blown C implementation. anyways,
it might be worth doing a little bit of benchmarking before completely
writing python off..
-Paul
On Mar 23, 2010, at 14:21 PM, [email protected] wrote:
Hi Paul,
Thanks for the reply. By "not working" I meant that no data appears and
therefore the script stalls on the line
data = s.recvfrom(1024)[0]
Also, currently I don't need very high data rates (~ 10Mb/s), but I will
need them in the near future.
Sean
Hi Sean,
I've used python code almost identical to yours pretty successfully,
mainly for simple tests/debugging. Whether or not this is the right way
to build a bigger application depends on things like the data rate you
need to support, any additional data processing/formatting that needs to
be done, etc.
What form of "not working" are you experiencing? ie, an error message, no
data appears, data comes in but you can't keep up with it... or something
else?
-Paul
On Tue, 23 Mar 2010, [email protected] wrote:
Hi all,
I need to dump data from a ROACH board to a PC over the 10gbe. Do
any of you have any recommendations for what I should use as a client
to handle the incoming data?
I've been trying to use a simple Python client like,
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind((ip_address, port))
data = s.recvfrom(1024)[0]
where "ip_address" is the address of the pc's 10gbe nic. This has
worked... only occasionally. And I'm not sure why it fails. Using
Wireshark I can see the incoming packets are coming in with 1024
bytes from the ROACH as I expect. Any thoughts?
Thanks a lot.
Sean