Skip to content

Multiprocessing with libf0.swipe #10

@akustiker

Description

@akustiker

For some experiments, I used libf0.swipe in a multiprocessing pipeline to compute pitch estimates for multiple audio files in parallel.

I noticed that libf0.swipe consumes all CPU power on our Linux server. This is due to some NumPy functions that perform multiprocessing for calculations.

To regulate NumPy, I did something like this in my user code:

import os

# Set the number of threads for OpenMP
os.environ['OMP_NUM_THREADS'] = '1'

# Set the number of threads for MKL
os.environ['MKL_NUM_THREADS'] = '1'

# Optionally, set the number of threads for NumExpr if you're using it
os.environ['NUMEXPR_NUM_THREADS'] = '1'

# Your NumPy code goes here
import numpy as np

I'm not sure if this should be part of the library or mentioned in the README.md?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions