我正在探索Julia的并行计算,并尝试了以下方法:
a=dzeros(5);a[1]=5
但是刚得到这个错误:
setindex! not defined for DArray{{Float64, 1, Array{Float64, 1}}
好吧,我认为该手册setindex!
已由完全实施DArray
。我错过了什么?
我正在Windows 32位上使用v0.2.1。
我也只是一个探索者,但是在阅读了Julia的Distributed Arrays Docs之后,我尝试了一下,似乎很奏效。
$ ./julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.0-prerelease+2703 (2014-04-22 18:57 UTC)
_/ |\__'_|_|_|\__'_| | Commit 942ae42* (0 days old master)
|__/ | i686-redhat-linux
julia> versioninfo()
Julia Version 0.3.0-prerelease+2703
Commit 942ae42* (2014-04-22 18:57 UTC)
Platform Info:
System: Linux (i686-redhat-linux)
CPU: Genuine Intel(R) CPU T2250 @ 1.73GHz
WORD_SIZE: 32
BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm
julia> a=dzeros(5)
5-element DArray{Float64,1,Array{Float64,1}}:
0.0
0.0
0.0
0.0
0.0
julia> localpart(a)[1]=5
5
julia> a
5-element DArray{Float64,1,Array{Float64,1}}:
5.0
0.0
0.0
0.0
0.0
julia>
在您将分布式数组设置为“本地”之前,似乎它们并不是“本地”的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句