numba parallel on mac, not working
See original GitHub issueimport numba
print(numba.__version__)
numba.set_num_threads(4)
numba.config.NUMBA_NUM_THREADS = 4
import time
@numba.njit(parallel=True)
def f(n):
s = 0
for i in numba.prange(n):
for j in range(n):
for k in range(n):
s += (i * k < j * j) - (i * k > j * j)
return s
t1 = time.time()
f(5000)
t2 = time.time()
print(t2-t1)
my test code as above. numba==0.55.0 I have run on my mac, and linux
- on mac, only use 1 cpu = 100%
- on linux, can use 400%
how to use multi cpus on mac? thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top Results From Across the Web
The Threading Layers — Numba 0.50.1 documentation
This section is about the Numba threading layer, this is the library that is used internally to perform the parallel execution that occurs...
Read more >parallel flag in @jit does not work in my code with numpy 2D ...
Judging from the error message, I assume numba has an issue figuring out the reference of the result array to write into. Note...
Read more >Parallel Computing Principles in Python - GitHub Pages
The function prange tells Numba that the corresponding for-loop can be parallelised. Numba automatically splits this for-loop into threads that work ...
Read more >Compiling Python classes with @jitclass
Not all compiling features are exposed or implemented, yet. Numba ... operations of jitclasses work in both the interpreter and Numba compiled functions:....
Read more >14. Parallelization
We just saw one approach to parallelization in Numba, using the parallel flag in @vectorize . This is neat but, it turns out,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

hi, sorry reply late. after I uninstall and conda install everything work!
thanks
Closing as the issue seems to be solved.