Warning: macos 10.12.* bug with SharedArray: shm_open() failed


#1

The following program triggers a bug in macos 10.12.*, but not in 10.13.* :

(nprocs()>1) || addprocs(1)

function sharedarray_parallel_sum()
    sa = SharedArray{Float64}(5)
    @sync @parallel for i=1:5; sa[i] = timingfun(); end#for
    sum(sa)
end#function

@everywhere function timingfun();  return sqrt(2.0); end;

println("Number of Processors: $(nprocs()).")

## works with 100, but dies with 1000
for i=1:1_000; sharedarray_parallel_sum(); end

the precise bug is

Number of Processors: 2.
ERROR: LoadError: On worker 2:
SystemError: shm_open() failed for /jl047505QBT91bdhwS4cz86EgGYm: Too many open files
_link_pipe at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib:?
...

I have run it up to 100_000 on 10.13.*, and it does not trigger this bug.