SharedArrays. Stability

I’ve conducted package upgrade from official repositories on 21 Dec. I ran Julia v0.7.0 and i’d noticed one of my SharedArray’s had returned procs(S)=Int64[0]. I’d migrated to Julia v1.0.3. Same thing.

I’d put @info’s along the initialization part of the outermost calling function, where SharedArray of interest is created, and observed, procs(S) = Int64[0] happens at random line, right from the beginning or doesn’t at all, like random event, with higher probability the more lines are executed in the same local scope. I created those shared arrays by specifying pids kwarg with Array{Int64,1}. When i’ve changed pids type to UnitRange{Int64}, bug had never been observed since.

using SharedArrays
function o102e(jstart::Int,jend::Int,tJn::Int;NN1::Int64=32000,NN2::Int64=126000,pids=2:13)
    NN=NN1+NN2
    zut=SharedArray{Float64}(NN, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    w  =SharedArray{Float64}(NN, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    si  =SharedArray{Float64}(NN, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    dsi =SharedArray{Float64}(NN, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    @info string("344 zut ",length(procs(zut)))
    u  = SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    @info string("352 zut ",length(procs(zut)))
    siu =SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    dsiu=SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    @info string("365 zut ",length(procs(zut)))
    epso    =SharedArray{Float64}(NN , init = S -> S[localindices(S)] .= 0.0,pids=pids)
    tuwa =SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    dtuwa=SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    Tchi =SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    sichi2=SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    chis =SharedArray{Float64}(NN1, init = S -> S[localindices(S)] .= 0.0,pids=pids)
    @info string("379 zut ",length(procs(zut)))
    # return length(procs(zut)),procs(zut)
end
begin
    @info "alpha!"
    for k=1:20
        o102e(260001,262001,260000,pids=collect(2:13))
    end
end
begin
    @info "omega!"
    for k=1:20
        o102e(260001,262001,260000,pids=2:13)
    end
end

Julia Version 1.0.3
Commit 04330c0 (2018-12-16 21:23 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.0 (ORCJIT, sandybridge)

A MWE of your problem would help people understand exactly what you’re trying to do, and how we can help:

1 Like

I’ve just updated.

Resolving package versions...
 Installed CodeTools ── v0.6.4
 Installed Atom ─────── v0.7.12
 Installed Tokenize ─── v0.5.3
 Installed WebSockets ─ v1.2.0
 Installed IJulia ───── v1.15.1
 Installed DataFrames ─ v0.16.0
  Updating `~/.julia/environments/v1.0/Project.toml`
  [c52e3926] ↑ Atom v0.7.11 ⇒ v0.7.12
  [a93c6f00] ↑ DataFrames v0.15.2 ⇒ v0.16.0
  [7073ff75] ↑ IJulia v1.14.1 ⇒ v1.15.1
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [c52e3926] ↑ Atom v0.7.11 ⇒ v0.7.12
  [53a63b46] ↑ CodeTools v0.6.3 ⇒ v0.6.4
  [a93c6f00] ↑ DataFrames v0.15.2 ⇒ v0.16.0
  [7073ff75] ↑ IJulia v1.14.1 ⇒ v1.15.1
  [0796e94c] ↑ Tokenize v0.5.2 ⇒ v0.5.3
  [104b5d7c] ↑ WebSockets v1.1.1 ⇒ v1.2.0
  Building IJulia → `~/.julia/packages/IJulia/3k6Fz/deps/build.log`

[ Info: alpha!
[ Info: alpha!
[ Info: alpha!
[ Info: 344 zut 12
[ Info: 352 zut 12
[ Info: 365 zut 12
[ Info: 379 zut 0
[ Info: 344 zut 12
[ Info: 352 zut 12
[ Info: 365 zut 12
[ Info: 379 zut 12
[ Info: 344 zut 12
[ Info: 352 zut 12

And there are no more zeros happening except this one. Consequent runs return ‘12’.