New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue with prange writing to preallocated list entries #4294
Comments
CC @DrTodd13 |
@stuartarchibald I'm unable to replicate.
|
@DrTodd13 thanks for trying, after poking about a bit more, I think this is related to core count. I'm going to guess that you ran this on a >10 core machine? Try this one, I get 4 distinct blocks of results, and ran this on a 4 core machine: from numba import njit, prange
import numpy as np
@njit(parallel=True)
def ilikebuffers(x):
n = 100
buf = [np.zeros_like(x) for _ in range(n)]
for i in prange(n):
buf[i] = x + i
return buf
a = np.ones((2,))
out = ilikebuffers(a)
[print(x) for x in out]
print("")
out = ilikebuffers.py_func(a)
[print(x) for x in out] also if I set Thanks. |
@stuartarchibald Confirmed. NUMBA_NUM_THREADS=1 gives me an output consisting of all 10's. |
Reporting a bug
latest releasedmaster version of Numba (most recent is visible inthe change log (https://github.com/numba/numba/blob/master/CHANGE_LOG).
to write one see http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).
This:
does this:
and it shouldn't. Suspect it's analysis of writing to the loop slots, but may be something else.
The text was updated successfully, but these errors were encountered: