-
Notifications
You must be signed in to change notification settings - Fork 17
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
Use of threads in library. #68
Comments
The parasail_aligner application that comes with the C library does allow you to specify the number of threads to use. The Python bindings are only for the C APIs and not the full parasail_aligner application. The alignment functions were always single-threaded, for C or Python. If you want to align sequences in parallel using threads in python, you would need to use one of the Python built in threading modules in such a way that each thread does one or more pairwise alignments. I do not have any sample code for that, sorry. |
Hey! no worries, thanks for your insight. I can manage to create a snippet of code to utilize parasail with threads in python! 👍 Appreciated! 😄 |
When trying to parallelize computations with python threads, be aware of the Global Interpreter Lock (GIL): The effect of this lock is that, at any time, only one python thread can actually make computations. This means, you do not gain any CPU performance by using python threads. This does not make sense for applications that want to use multiple CPUs for CPU-bound applications. Still it was the right decision for python. You can learn more about this in this video: PyCon 2015-Pythons Infamous GIL by Larry Hastings. |
Hi! It's possible to specify the number of threads to use in the calculations?
the original library allows to modify this value, I was wondering if the python binding is able to do this.
Thanks!
The text was updated successfully, but these errors were encountered: