khmer multiprocessing#638
Conversation
|
Test PASSed. |
There was a problem hiding this comment.
Does OpenMP work without releasing the GIL?
Should the Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS be put here or at the Python extension? I guess at the Python extension, since the lib is Python-independent.
There was a problem hiding this comment.
My understanding was that the GIL doesn't come into play here because there
aren't any python threads or references to python objects, and thus no
python bytecode running through the interpreter; some preliminary
performance profiling seems to indicate that's the case. I could be wrong
though.
On Fri, Oct 24, 2014 at 10:44 AM, Luiz Irber notifications@github.com
wrote:
In lib/hashtable.cc:
n_consumed++; }
- for (unsigned int i=0; i<s.length()-_ksize; ++i) {
- }
- */
- std::vector hashes;
- while(!kmers.done()) {
hashes.push_back(kmers.next());- }
- #pragma omp parallel
Does OpenMP work without releasing the GIL?
Should the Py_BEGIN_ALLOW_THREADS / Py_END_ALLOW_THREADS be put here or at
the Python extension? I guess at the Python extension, since the lib is
Python-independent.—
Reply to this email directly or view it on GitHub
https://github.com/ged-lab/khmer/pull/638/files#r19342467.
Camille Scott
Department of Computer Science and Engineering
Lab for Genomics, Evolution, and Development
Michigan State University
There was a problem hiding this comment.
On Fri, Oct 24, 2014 at 07:48:30AM -0700, Camille Scott wrote:
n_consumed++; }
- for (unsigned int i=0; i<s.length()-_ksize; ++i) {
- }
- */
- std::vector hashes;
- while(!kmers.done()) {
hashes.push_back(kmers.next());- }
- #pragma omp parallel
My understanding was that the GIL doesn't come into play here because there
aren't any python threads or references to python objects, and thus no
python bytecode running through the interpreter; some preliminary
performance profiling seems to indicate that's the case. I could be wrong
though.
As you say.
Plus, it'd crash. CPython is pretty good about crashing in this kind of
situation.
|
Test FAILed. |
There was a problem hiding this comment.
Note: move these inside try {} block.
There was a problem hiding this comment.
This link says only the OpenMP master thread can deal with exceptions, so there might be another changes lurking here.
|
Test FAILed. |
There was a problem hiding this comment.
Note to self / general: We care very much, because unsigned ints have module sizeof behavior (they loop back around to zero).
Bring in fixes to threading in do-partition.py
|
Test FAILed. |
1 similar comment
|
Test FAILed. |
…and normalize-by-median flags
|
TODO:
|
|
Example usage from Python can be found here: https://github.com/camillescott/khmer-metrics/blob/master/test_async_diginorm.py @ctb @mr-c @luizirber thoughts on the Python interface are welcome. As of now, interaction with processed reads is mediated by an iterator over the output queue, which returns khmer::read_parsers::Read objects. |
|
Closing in favor of #655 |
Outstanding PR for experimenting and eventually finalizing multithreading/processing in khmer.