- shmem_rand(I::Int...; kwargs...) = shmem_rand(I; kwargs...)
- function shmem_randn(dims; kwargs...)
- SharedArray{Float64,length(dims)}(dims; init = S-> map!(x -> randn(), S.loc_subarr_1d, S.loc_subarr_1d), kwargs...)
- end
- shmem_randn(I::Int...; kwargs...) = shmem_randn(I; kwargs...)
- similar(S::SharedArray, T::Type, dims::Dims) = similar(S.s, T, dims)
- similar(S::SharedArray, T::Type) = similar(S.s, T, size(S))
- similar(S::SharedArray, dims::Dims) = similar(S.s, eltype(S), dims)
- similar(S::SharedArray) = similar(S.s, eltype(S), size(S))
- reduce(f, S::SharedArray) =
- mapreduce(fetch, f, Any[ @spawnat p reduce(f, S.loc_subarr_1d) for p in procs(S) ])
- reduce(::typeof(vcat), S::SharedVector) = invoke(reduce, Tuple{Any,SharedArray}, vcat, S)
- reduce(::typeof(hcat), S::SharedVector) = invoke(reduce, Tuple{Any,SharedArray}, hcat, S)
- function map!(f, S::SharedArray, Q::SharedArray)
- if (S !== Q) && (procs(S) != procs(Q) || localindices(S) != localindices(Q))
- throw(ArgumentError("incompatible source and destination arguments"))