Can someone tell me what's wrong with the following code.
- When I run it, either the last for loop would just hang there or I
would get an error message such as
run=12
> 100
> LoadError: SystemError: shm_open() failed for
> /jl024406KYMveTGtI7BVrX6waGws: Too many open files
> while loading In[4], in expression starting on line 20
- If regular array is used, there would be no such problem.
- I suspect that this is also the culprit that I encountered in a
previous post titled "(Large memory) computations and disk swapping
Here is the code:
function test(N=10000)
#@sync K=SharedArray(Complex{Float64}, (N,N), init = S ->
S[Base.localindexes(S)] = rand())
K=SharedArray(Complex{Float64}, (N,N))
#K=fill(Complex{Float64}, (N,N))
end
for i=1:4
@time test(10);
end
N=[100 200 400 800]
for run=1:20
println("run=", run)
for n in N
println(n)
test(n);
end
end