-
Notifications
You must be signed in to change notification settings - Fork 32
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
Session.run() hangs with sample rates < 100kSps and number of samples > 256/512 #193
Comments
Hi, Unfortunately I didn't manage to reproduce the issue you experienced. I ran the example code you provided, tested a few combinations of nb_samples versus samplerate (similar with what you described), but the script did not hang. Could you tell us what operating system are you using? Thank you! |
Hi Alexandra, thanks for the quick reply, and sorry for the late response. I unfortunately didn't find the time to dig into this deeper until now. To answer your questions first: After trying a few things, I found out that the script also worked on another Win10 machine - which also had Python 3.7 installed, but with a fresh install of libsmu/pysmu from conda (no previous libsmu versions were installed). After setting up a Python 3.9 environment on that machine, and installing libsmu from conda, I again got the same results as on my main machine - a hang when I run the script. Tried on a 3rd machine, same results. So it seems the issues is the Python version. Going back to the original machine, I uninstalled the previous libsmu installation (the Github releases Windows installer one) as per your suggestion, then created a new Python 3.7 virtualenv and installed libsmu from conda - and it worked. So it seems this behavior depends on the Python version. By the way, I am using Anaconda to manage the Python versions, packages and virtualenvs. If you need any further information, please let me know. Thanks! |
Hi, I ran some tests on all the python versions you mentioned, using Anaconda to manage them, and I can confirm the issue. Thank you! |
Hi, thanks for the quick response. Please let me know if I can do anything to help. BR |
Hi,
first of all, thanks for all the work on libsmu and pysmu - I am currently trying to create some current pulse profiles with the ADALM1000 with some custom Python code using pysmu, and I ran into some issues with low sample rates.
The current pulses I want to generate are in the length of seconds (e.g. 10mA for 2s, then 5s pause), so the default sample rate of 100kSps is a bit overkill and leads to huge sample lengths. But when I reduce the sample rate to 10kSps or 1kSps, libsmu/pysmu seems to get stuck in an endless loop when calling Session.run() (or Session.start(), or Device.get_samples(), etc.).
The interesting thing is that everything works as expected as long as the number of samples requested is below a certain threshold - which seems to be always a power of 2. But this only applies to sample rates below 100kSps (more specific: below 10240Sps).
This behavior can be triggered with very simple code:
The above example hangs at
s.run(n_samples)
. It seems the same happens for all valuesn_samples > 256
.If I change the code to
n_samples = 256
, the code works. Again, it seems it also works for all valuesn_samples <= 256
.The same happens if I change the code to
samplerate = 10000
, but with the next power of 2 for the number of samples.With
n_samples = 512
(and below) the code works, withn_samples = 513
(and above), the code stops working.Since the sample rate is limited to 1kSps on the lower end by libsmu (as is seems), I cannot check further. Also, when I increase the sample rate to
samplerate = 100000
, the code does work regardless ofn_samples
(I tried up to 10M samples, along with Session.queue_size set to 10M).I played around a bit with the sample rate, and saw that this behavior seems to happen only with
samplerate <= 10240
(but works fine for 10241 and above), with a threshold ofn_samples > 512
, and withsamplerate < 5120
and thresholdn_samples > 256
, which is oddly specific.Can you reproduce this behavior? I am using libsmu 1.0.3 from conda (installed the latest release today) with Python 3.9, but I had the same issue with Python 3.7. The ADALM1000 is use is HW revision F with FW version 2.17.
Please let me know if I should provide any further information.
Thanks,
BR
Stefan
The text was updated successfully, but these errors were encountered: