I am continuing my reporting of bugs with multi-threading on Julia. I am using v1.1.0 and running on 4 threads. The following code
using SparseArrays;
using Serialization;
N=1000;
oneN=fill(1.0, N);
K=spzeros(N,N);
Threads.@threads for i in 1:N
K[i,i] = 1.0;
end
gives the strange error
Error thrown in threaded loop on thread 2: BoundsError(a=Array{Float64, (17,)}[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], i=23)
Error thrown in threaded loop on thread 0: BoundsError(a=Array{Float64, (17,)}[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], i=22)
Error thrown in threaded loop on thread 1: BoundsError(a=Array{Float64, (17,)}[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], i=22)
Error thrown in threaded loop on thread 3: BoundsError(a=Array{Float64, (17,)}[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], i=23)
This is a very simple use of multi-threading, without any I/O. Could you tell me what is going wrong ? Thanks.