Lowering Error while trying to run parallel with prange
See original GitHub issueHello. Whenever I run this code:
from numba import njit, prange
@njit(parallel=True)
def s(n):
lis=[]
for i in prange(n+1):
lis.append(i)
return lis
s(1)
It gives me LoweringError: And if I make lis into an empty np array:
from numba import njit, prange
import numpy as np
@njit(parallel=True)
def s(n):
lis=np.empty(0)
for i in prange(n+1):
lis=np.append(lis,i)
return lis
It gives ‘ValueError: Failed in nopython mode pipeline (step: convert to parfors) Use of reduction variable lis in an unsupported reduction function.’ And checking the internet I didnt find any solution to this. Thanks in advance
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Parallel prange gives LoweringError · Issue #4903 - GitHub
It is kind of a delicate error, and further simplification of my MWE leads to a successful parallel compile. I use the environment....
Read more >Parallelize with numba's prange and passing along a tuple
LoweringError : Failed at nopython (nopython mode backend) scalar type tuple(array(int64, 1d, C) x 2) given for non scalar argument #2 File "< ......
Read more >Automatic parallelization with @jit - Numba
parallel =True ) is support for explicit parallel loops. One can use Numba's ; prange instead of ; range to specify that a...
Read more >Frequently Asked Questions - Numba documentation
Why are the typed containers slower when used from the interpreter? Does Numba automatically parallelize code? Can Numba speed up short-running functions? There ......
Read more >Parallel computing in Cython - threads - Neal Hughes
How to run multiple threads in Cython. ... from cython.parallel import prange def c_array_f_multi(double[:] X): cdef int N = X.shape[0] cdef ...
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
No problem RE: open/close.
As the above sample involving
triplePartition
is a more general question, I’d recommend asking it on the Numba discourse forum https://numba.discourse.group/ 😃 Thanks!Also, sorry for closing and opening, I misclicked