Giter Site home page Giter Site logo

Threads over-subscription about nanocompore HOT 7 OPEN

tleonardi avatar tleonardi commented on June 18, 2024
Threads over-subscription

from nanocompore.

Comments (7)

tleonardi avatar tleonardi commented on June 18, 2024

I have to look into the issue more carefully, not sure why/when it happens, but it happened more than once already. @a-slide do you have any idea?

from nanocompore.

tleonardi avatar tleonardi commented on June 18, 2024

Ok, it looks like I figured it out. On my system numpy is built against openBlas, which by default is multithreaded. The result is that the np.array() call in __process_references() spawns multiple threads (and every worker process does the same).
Since we are using multiprocessing, the solution seems to be to disable multithreading for openBlas and mkl before importing numpy:

import os
os.environ["MKL_NUM_THREADS"] = "1"
os.environ["MKL_THREADING_LAYER"] = "sequential"
os.environ["NUMEXPR_NUM_THREADS"] = "1"
os.environ["OMP_NUM_THREADS"] = "1"

I'm currently testing whether it works as it should.. will commit as soon as I'm sure all is fine.

from nanocompore.

a-slide avatar a-slide commented on June 18, 2024

I did not notice, but my version is actually also build against OpenBlas.
I had a quick look as well and it looks like the method you describe should work but you might want to include that as well

os.environ['OPENBLAS_NUM_THREADS'] = '1'

from nanocompore.

a-slide avatar a-slide commented on June 18, 2024

Not completely fixed apparently.
Numpy is still causing issues in a cluster environment.
An option to explore might be to use this package to set the number of threads:
https://github.com/joblib/threadpoolctl

from nanocompore.

tleonardi avatar tleonardi commented on June 18, 2024

This should be fixed by #94 but I haven't tested it yet. Did you?

from nanocompore.

tleonardi avatar tleonardi commented on June 18, 2024

I think it's fixed

from nanocompore.

tleonardi avatar tleonardi commented on June 18, 2024

But it's not, reopening.

from nanocompore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.