You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we are using multiprocessing for example in peaks_from_model we can setup the number of processes (for example at 4) but because some of the code will use multi-threading through numpy (Openblas, MKL) we end up using more cores than necessary (for example 12 instead of 4). This can end up delaying execution or just use too many resources freezing the computer.
A solution for this is to disable multithreading when multiprocessing. This can be done using the following snippet:
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
os.environ['MKL_NUM_THREADS'] = '1'
I suggest that we set the values above before multiprocessing starts and set them back to default after the work is done. In that way we will not affect execution to functions that do use multithreading.
The text was updated successfully, but these errors were encountered:
When we are using multiprocessing for example in
peaks_from_model
we can setup the number of processes (for example at 4) but because some of the code will use multi-threading through numpy (Openblas, MKL) we end up using more cores than necessary (for example 12 instead of 4). This can end up delaying execution or just use too many resources freezing the computer.A solution for this is to disable multithreading when multiprocessing. This can be done using the following snippet:
I suggest that we set the values above before multiprocessing starts and set them back to default after the work is done. In that way we will not affect execution to functions that do use multithreading.
The text was updated successfully, but these errors were encountered: