Open
Description
When import fft from mkl_fft, the code below runs in a single CPU (two threads, image 1). However, when importing fft from scipy, the code runs simultaneously in multiple CPUs (N = 15 in my case, image 2).
#from scipy.fft import fft, ifft
from mkl_fft import fft, ifft
import multiprocessing as mp
import numpy as np
def test_fft(ii):
for jj in range(100000):
x = ii*np.random.random(2**12)
y = fft(x)
z = ifft(y)
if __name__ == '__main__':
N = mp.cpu_count() - 1
pool = mp.Pool(N)
pool.map(test_fft, range(20))
pool.close()
pool.join()
Activity
oleksandr-pavlyk commentedon Sep 3, 2023
If you are using
conda
, it would be helpful if you could share output ofconda list --explicit
.If not, please instruct how to reproduce your findings.
ysarri commentedon Sep 3, 2023
Yes, I am using conda, this is the output of
conda list --explicit
: